Jump to content
  • Advertisement


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


Extracting command line arguments from LPSTR?

This topic is 6306 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
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''


Multiple arguments will be seperated by spaces.

What problem are you having accessing it?


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!