Hello all, I am a beginner to win32 programming and OpenGL.
Now having a problem about reading the command line, hope anyone would help.
I am writing a win32 program that reads a file on the command line.
The file contains vertex informations to draw with OpenGL.
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
Let’s say my program is named “draw.exe” and I’d like to read the file “data.txt”.
So I run “draw.exe data.txt”.
How can I make the lpCmdLine becomes a character string? so that I can manipulate it with simple C++ commands?
fopen(lpCmdLine, “r”) fails to work.
or is there a way that I can convert the data type LPSTR to char string?
Thanks a lot!