If you'd like to open a separate command window, just execute a system ("cmd.exe"); call. If you want to make your own command interpreter, write it, and replace "cmd.exe" with "myCommandInterpreter.exe" (or whatever you call it). Code: #include <windows.h> #include <process.h> #include "stdafx.h" extern "C" int system (char *cmd); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { system ("cmd.exe"); return 0; }
Well you see I just want a console in my GUI program because I need this to do some winsock because yeh... Well please tell me how to make a console type thing inside a GUI program?? This is very important to me
No, I don't see. Do you see? Did you even read the response? Do you see that it opens a console (without writing the rest of your code, of course). If you don't want the system's console window, make your own window and write your own command interpreter.
.h file can do nothing apart from just having some function signatures and stdafx file just does absolutely nothing apart from including some more headers files.
I have made this Batch File and I want a text box kind of thing (where user can input) to be related to a batch file... so that if in my batch file i have for example set hello= set /p hello=Command: well that "Command:" appears in the text box in the c++ program...
You put a textbox in your app and ask for the input from the user and save it in a batch file on some place in the local disk.
no because actually this thing i want is to put some console c++ apllication into a text box... is that possible
I doubt that but may try this. Have a custom control on the Dialog and change the class of the control to ConsoleWindowClass see if that works for you.
Ok, yeh well that is not really my point, i want to link a console based program to a text box area inside my GUI window