Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateDC("DISPLAY", ...) <--"DISPLAY" not recognized !! 1

Status
Not open for further replies.

iza

Programmer
Apr 4, 2000
1,804
FR
heeelp !
CreateDC("DISPLAY", NULL, NULL, NULL) was working perfectly
and suddendly ... error C2664: 'CreateDCW' : cannot convert parameter 1 from 'char [8]' to 'const unsigned short *'
i *know* this is a beginner question, but what have i done for it NOT to work anymore ? and why my "CreateDC" became "CreateDCW" in the error message ?? what is to do to fix it ?
thanx for any answer !!

 
iza,

What did you change? Perhaps you added the _UNICODE pre-processor symbol to your project settings?

-pete
 
i found out that the projects settings had been changed, as you say -> it was not in debug mode anymore but in release mode ... does it mean that when i want to release my app then it won't work ??
 
iza,

First you need to check all your project settings. These problems ususally stem from people changing settings when they don't realize there are both Debug and Release settings for the same project. The two modes should be identical in settings that effect the release build attributes you desire.

I was able to reproduce your problem by changing the default MFC App Wizard setting _MBCS to _UNICODE. Once the settings contained the UNICODE symbol the very problem you posted appeared during build in Release mode. To remove the error modify your code to use the TEXT macro which provides the appropriate pre-processor conversion for you.

CreateDC(_T("DISPLAY"), NULL, NULL, NULL)

Hope this helps
-pete
 
ok, thanks :)
i'm totally lost with these visual studio stuff ... :-( and their doc is a mess s-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top