Hi, I'm developing a framework ( GDK ) similar to Game Maker, but with Irrlicht for the graphic part and GUI. I would like to add a feature in order to make possible lunching c++ compiler within the project editor, but I don't know how to redirect the compiler output to a string for presenting it in a Irrlicht GUI widget.
I think that the command for execute external program would be system(program_name), but I'm not sure this is the unic or correct way.
Some days ago I watched to the source code of CODE-BLOCK ide, but I don't get the solution. That project is complex to analyze, and find the correct piece of code that make what I want to do is not simple. I'm not sure wath I could search......
Is possible to do something like this ( syntax errors excluded )?
var_string = cout << system(program_name);
Many thanks for help.
Alberto Rubinato
Output Redirect ( c++ compiler output to Irrlicht GUI )
you can use ShellAPI,
ShellExecute(blah, blah blah ....
the last argument you can run the program hidden, as background, the second is arguments i think, the first is the program location... Its probably most useful, there are ways to represent the compilers output, search around, if there wasn't, how would the IDE's do it. heh.
ShellExecute(blah, blah blah ....
the last argument you can run the program hidden, as background, the second is arguments i think, the first is the program location... Its probably most useful, there are ways to represent the compilers output, search around, if there wasn't, how would the IDE's do it. heh.
oh, and no its not possible, i mean, it doesn't make since to do that. cout is the routine that displays text to the prompt. and to put it in a string variable wouldn't make much since at all. You probably would be better reading about c++... before starting on such a difficult project. Im not trying to offend, but I'm just saying it is going to be crazy difficult going at a project like this. as matter of fact i do beleive this has been tried by many people, and often died off.. good luck either way.
Under windows, don't use system(). Use ShellExecute(). The first parameter is an HWND of a window that you want the output to go to. You can then create a hidden window to put the output in and read the text out of there.
It's going to be a little more involved than thatvar_string = cout << system(program_name)