How to use command line with WinMain()?
I currently launch my prog, "viewer.exe" which reads in my world data, "world.dat", but the name "world.dat" is hard-coded into "viewer.exe".
I would like to launch viewer with command line parameters such as
"viewer.exe world.dat 800x600x32"
in order to choose the world data file to read in and, for example, the resolution.
I knew how to do this with the dos main() function but how does it work with winmain()?
Thanks for your help.
I haven''t personally used the winmain() command line parameters, only dos. But wimain() has a 3rd parameter that is a pointer to a null terminated command line string, often named szCmdLine in the parameter list. Exploit that.
Well, R2D22U2..
GetCommandLine()
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement