Jump to content
  • Advertisement
Sign in to follow this  

visual studio issues.

This topic is 3037 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 been following a book as of late to get a grasp on Windows game programming.
It uses the C language and is from 2005
I have been fine with everything so far until I started the directx chapter,
as I was using Dev-C++,
and since I'm not exactly sure how to get it working with DX,
I switched to using Visual Studio as is used in the book.

I have Visual Studio 2008 and then book uses 05

Issue is code that compiles fine with DevC++ doesnt with VS,
such as:

cannot convert from 'const char [18]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

this is my defined APPTITLE for the title bar of my window.
I've tried to cast it with (LPCWSTR) but nope.

Also some simple errors like a semi colon being a colon and forgetting a variable name gave errors of course, but after I fixed them I still get the exact errors..?

I've recompiled, rebuilt, refrickin everything you can do lol.

I guess real question is, should i keep using this book,
is it outdated? Should I be learning DX with C++?
I have many books and sure I can use another but It was just getting interesting..

Share this post

Link to post
Share on other sites
Short answer: go to your project properties and look for the character set property. Change it from unicode to multi-byte and the LPCWSTR errors should go away.

Share this post

Link to post
Share on other sites
Have a read over This.

Or, as a short answer, go to project settings (Alt+F7) -> Configuration Properties -> General, and set Character Set to "Use Multi-Byte Character Set". You'll need to do that for debug and release.

EDIT: Bah, too slow

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!