Jump to content
  • Advertisement
Sign in to follow this  

Visual Studi0 2005, DirectX and Message Boxes (Solved)

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

So I've just got Visual Studio 2005 Std, and so I've also got a couple of problems. First, (I'm using C++) While trying to program with native Win32 in Visual Studio I get this error message with the MessageBox() function.
MessageBox(NULL, "Hello", "Title", MB_OK);
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast I've tried casting the parameters, it works, but the text in the message box is gibberish. Visual Studio also installed the PSDK while I was installing it off the disk...I think. My other problem is with DirectX 8.1. I've added the search directories for the libraries and headers in visual studio, but for some reason it won't work. I'm thinking that I might have to individually add the files I need into the project... Here's the code that won't compile.
DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7, NULL);
error LNK2001: unresolved external symbol _DirectDrawCreateEx@16 error LNK2001: unresolved external symbol _IID_IDirectDraw7 In my code I also have #define DXGUID, so I think the problem is that I haven't specified all the import files I need. Any help is very much appreciated! Thanks! [Edited by - TaylorGJ on March 20, 2007 5:23:33 AM]

Share this post

Link to post
Share on other sites
Original post by CandleJack
I'm using 2003 so I hope this is still the same, but did you add the libraries in the project properties?
It's not exactly the same, but it's very similar.

As for the first problem, go to project settings -> General (or something, the first page that opens by default) and change "Character Set" from "Unicode character set" to "Multi-Byte Character Set".

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!