To execute a program, you must communicate its path and possibly some additional parameters to the compiler. This information is called the command line information and it is supplied as a string. You need to keep that in mind although all programs of our lessons will be compiled inside of Visual C++. The command line information is supplied to the compiler as the lpCmdLine argument of the WinMain() function. Internally, Visual C++ creates the path and communicates it to the compiler when you execute the program. If you want to find out what command line was used to execute your program, you can call the Win32's GetCommandLine() function. Its syntax is:
LPTSTR GetCommandLine(VOID);
This function takes no argument but returns the command line of an application as a null-terminated string.
Comments
Post a Comment