• Advertisement

Archived

This topic is now archived and is closed to further replies.

Extracting command line arguments from LPSTR?

This topic is 6061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to do this? program.exe level.bsp In the above example LPSTR is supposed to be a pointer to the char* '' level.bsp''. I can''t seem to scan the characters. Paulcoz.

Share this post


Link to post
Share on other sites
Advertisement
Hmmm. What do you mean by scan them?

LPSTR is a typedef for char*.

Assuming you are getting this information from WinMain you treat it just like any other string. The actual argument is lpCmdLine not LPSTR. (If you let MSVC generate your WinMain that is...)

lpCmdLine[0] == ''l''
lpCmdLine[1] == ''e''
lpCmdLine[2] == ''v''
lpCmdLine[3] == ''e''

etc...

Multiple arguments will be seperated by spaces.

What problem are you having accessing it?

Seeya
Krippy

Share this post


Link to post
Share on other sites

  • Advertisement