Jump to content
  • Advertisement
Sign in to follow this  
Spriggan82

Passing program arguements as wchar_t

This topic is 4076 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

I can't seems to pass the program arguments in the Project->Settings->Debug->Program arguements text box as type wchar_t. I have come to this conclusion because the wchar_t variable i am trying to define is not being defined with the input that is in the program arguements box. My code is as follows: wchar_t fileName[256]; void CreateFileName( wchar_t *fn ) { swprintf( fileName, L"%ls", fn); //show names wprintf(L"File Name = %ls\n", fileName ); } int main(int argc, wchar_t* argv[]) { CreateFileName(argv[0]); } if I do the following, it works fine. int main(int argc, wchar_t* argv[]) { wchar_t* name = L"firstfile"; CreateFileName(name); return 0; } I have enable unicode by including #define UNICODE and _UNICODE, i'm using visual C++ 6.0 btw. Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!