Jump to content
  • Advertisement
Sign in to follow this  

Passing program arguements as wchar_t

This topic is 4161 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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!