Sign in to follow this  
TaylorGJ

Visual Studi0 2005, DirectX and Message Boxes (Solved)

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.
LPDIRECTDRAW7 lpdd;
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
Quote:
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this