Hi,
I have a problem with GetCommandLine API.
It usually returns the executable name followed by a space and arguments. As documentation says, the first token may not have complete path to image and blah blah blah.
I never had problems until now that I used CreateProcess with lpApplicationName not NULL
If I use:
CreateProcess(NULL, "\"c:\myexe.exe\" param1 param2", ...)
GetCommandLine returns "c:\myexe.exe param1 param2" as expected.
But if I use:
CreateProcess("c:\myexe.exe", "param1 param2")
GetCommandLine returns only "param1 param2".
So the question is, how do I know if executable name is given in cmd-line if another app launches mine?
Also, MFC startup code assumes that the first token in cmdline is the executable name and skips it. But if you launch a MFC app with the second CreateProcess api example, MFC's code will skip the first argument.
Regards, Mauro.