VC++ 8.0 Express & Unicode

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 138
Reputation: Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about 
Solved Threads: 14
Frederick2 Frederick2 is offline Offline
Junior Poster

VC++ 8.0 Express & Unicode

 
0
  #1
Dec 27th, 2008
Just downloaded VC++ 8.0 Express and tried to run a simple sdk style program to see what happens. I've been using Dev C++, CodeBlocks, and MS VC++ 6. I've been advised to get up to date. Anyway, to get the program to run I had to change all the Api calls with string parameters to 'A' versions. If my memory serves me correct with my other compilers there were #defines of UNICODE and/or _UNICODE that controlled whether 'A' or 'W' versions of the declares were compiled. When I saw what was happening I tried to #undef UNICODE and _UNICODE, but that didn't result in any positive outcome.

The other issue I had was with the .lpfnWndProc member of WNDCLASSEX. It appears WNDPROC must be redefined somewheres because intellisence was telling me it wanted a LPCWSTR instead of LPCTSTR or whatever it was before (believe that's right, and would reduce to LPCSTR if UNICODE wasn't defined). So to get that to work I had to put a 'L' in front of the string name of the window procedure.

Is there a way to just get it to default to the 'A' versions of things? I do a lot of Windows CE programming and there I've had to more or less make peace with the way things are so I use wchar_t instead of char and preface all my literals with 'L' as that seems like the easiest and cleanest alternative and spares me from those aweful TEXT and _T macros I really don't like very much. But up 'till now what little Windows desktop programming I do with C/C++ I've been spared the whole UNICODE thing. Looks like that's over with. Or is it possible to modify the VC++ environment to use ansi strings without having to postpend 'A' to everything?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: VC++ 8.0 Express & Unicode

 
0
  #2
Dec 27th, 2008
For VC++ 9 (2008):
Create/open the project then menu: Project|Properties then select Configuration Properties|General and set Character Set to Not Set.
I don't know how to do that in VC++ 8 (2005) but I suspect the same procedure...
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 138
Reputation: Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about 
Solved Threads: 14
Frederick2 Frederick2 is offline Offline
Junior Poster

Re: VC++ 8.0 Express & Unicode

 
0
  #3
Dec 27th, 2008
Thanks ArkM. I'll give that a try. I had snooped around in there looking for something relating to unicode settings, but as you know, its considerably different from my old VC 6 (actually, now that I've seen it, I know where the CodeBlocks look came from......).
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,433
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1471
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: VC++ 8.0 Express & Unicode

 
0
  #4
Dec 27th, 2008
In VC++ 2008 UNICODE is turned on by default . AFAIK there is no way to change this default behavior when creating a project. I always have to turn it off as ArkM posted.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: VC++ 8.0 Express & Unicode

 
0
  #5
Dec 28th, 2008
Or just get used to using TEXT() macros all over the place, and stop worrying about what each revision of the IDE defaults to for character encoding.

UNICODE isn't going away any time soon, so you're going to have to learn to deal with it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 138
Reputation: Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about Frederick2 has a spectacular aura about 
Solved Threads: 14
Frederick2 Frederick2 is offline Offline
Junior Poster

Re: VC++ 8.0 Express & Unicode

 
0
  #6
Dec 28th, 2008
Originally Posted by Salem View Post
Or just get used to using TEXT() macros all over the place, and stop worrying about what each revision of the IDE defaults to for character encoding.

UNICODE isn't going away any time soon, so you're going to have to learn to deal with it.
Yes, you're right Salem! But its hard! Last year I spent about six months working on a large Win CE program, and at some point I would like to be able to get that working on the Windows desktop. I'd have been a lot further ahead probably had I just caved in to the whole text macro thing (TEXT(""), and so forth), but, the stuff very much affronts my long developed coding style sensibilities.

C++ probably had no alternative in the matter, being as its the type of language it is. So acceptance is the only alternative if one is going to use C++. Other language products of course have other alternatives. Thanks again all for the feedback.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC