jukev
asked on
Using a compiler from within C# runtime code
I am writing a program in Builder 4 which creates a text skeleton of a program from an object diagram. I want to be able to compile this from within my program using something like the GNU free mingw32 compiler when the user clicks some button. Any suggestions?
Secondly can I get access to any output error messages etc? Ideally I would like this to appear to run as part of my own program rather than opening the dos window and being a separate entity. I want to give the user feedback from the compiler without them having to go back to my program for themselves. Is this possible?
Secondly can I get access to any output error messages etc? Ideally I would like this to appear to run as part of my own program rather than opening the dos window and being a separate entity. I want to give the user feedback from the compiler without them having to go back to my program for themselves. Is this possible?
Hi BitTwiddler,
Welcome to EE!
The experts in this section have agreed to post Comments rather than Answers. That prevents the question from being 'locked' -- keeps the question in the upper part of the list so that more experts will see it and provide help.
As you said yourself, your post is not a complete answer, and nothing less than a 'complete and only-possible valid' solution should be marked as an 'Answer'.
So in the future, please post Comments, like everybody else. Thanks!
-- Dan
Welcome to EE!
The experts in this section have agreed to post Comments rather than Answers. That prevents the question from being 'locked' -- keeps the question in the upper part of the list so that more experts will see it and provide help.
As you said yourself, your post is not a complete answer, and nothing less than a 'complete and only-possible valid' solution should be marked as an 'Answer'.
So in the future, please post Comments, like everybody else. Thanks!
-- Dan
ASKER
No offence BitTwiddler but I need a bit more help than this. At least a bit of an explanation of what that code does. I will have a go with what you have submitted but I want to open this back up to see if you or anyone else can give me a bit more info
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanx so much
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HAN
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HA
startInfo.hStdError = GetStdHandle(STD_ERROR_HAN
b = CreateProcess(
progname,
buf,
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&startInfo,
&pidInfo);
The example isn't complete, as you'd need to fill in additional fields of startInfo, pidInfo, etc., but this should get you going in the right direction.
HTH