Jump to content
  • Advertisement
Sign in to follow this  
Sawsan Emam

API probelm

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

Hi everyone, i am trying to compile an AVI application that works with AVI files but it keep on having the following Error: ERROR: cannot convert from 'char[]' to 'LPWSTR' ... in a function like DragQueryFile( hDrop, 0, lpszFile,_MAX_PATH ); i am using Visual Studio 2008 can anyone tell me why i have this error ... Thanks in advance, Sawsan A.Emam

Share this post


Link to post
Share on other sites
Advertisement
You're sending the wrong type of pointer to that function. The function is expecting a pointer of type "LPCWSTR", which in the windows headers is typedef'ed to "const wchar_t*". You're sending a pointer to an array of char's, hence the compilation error.

On a higher level, the problem is that the function is expecting a Unicode string and you're sending an ANSI string. See my blog entry about Unicode in the Windows API if you want to learn where you went wrong, and why Sc4Freak is telling you to change your character mode settings.

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.

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!