| | |
VC++ 8.0 Express & Unicode
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 138
Reputation:
Solved Threads: 14
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?
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?
•
•
Join Date: Jul 2008
Posts: 138
Reputation:
Solved Threads: 14
•
•
•
•
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.
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.
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Internet Explorer & Windows Explorer (desktop shortcuts) Won't Load! (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: quick pointer question
- Next Thread: Borland C++ Builder 6 : creating new objects - HOW ??
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets







. AFAIK there is no way to change this default behavior when creating a project. I always have to turn it off as ArkM posted.