From: Scott McPhillips [MVP] on 11 Mar 2008 14:41 "Rami" <rami(a)goren.org.ir> wrote in message news:eNaHDp5gIHA.5164(a)TK2MSFTNGP03.phx.gbl... > Thanks, > Following your detailed answer I looked again in the projects settings and > saw that all of them have "_MBCS" preprocessor definition. > Should I delete it or just add the "UNICODE" definition? > Thanks > Rami You should change it from _MBCS to UNICODE, all you also need to make all the code changes outlined in Joe's response to you. -- Scott McPhillips [VC++ MVP]
From: Ajay Kalra on 11 Mar 2008 14:45 I think you need both, UNICODE and _UNICODE. --- Ajay "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message news:eyLoGe6gIHA.1204(a)TK2MSFTNGP03.phx.gbl... > "Rami" <rami(a)goren.org.ir> wrote in message > news:eNaHDp5gIHA.5164(a)TK2MSFTNGP03.phx.gbl... >> Thanks, >> Following your detailed answer I looked again in the projects settings >> and saw that all of them have "_MBCS" preprocessor definition. >> Should I delete it or just add the "UNICODE" definition? >> Thanks >> Rami > > You should change it from _MBCS to UNICODE, all you also need to make all > the code changes outlined in Joe's response to you. > > -- > Scott McPhillips [VC++ MVP]
From: Bob Moore on 11 Mar 2008 19:32 On Tue, 11 Mar 2008 14:45:46 -0400, Ajay Kalra wrote: >I think you need both, UNICODE and _UNICODE. Yes, one is for the Windows api, the other for the C runtime, if memory serves. -- Bob Moore http://bobmoore.mvps.org/ (this is a non-commercial site and does not accept advertising) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Do not reply via email unless specifically requested to do so. Unsolicited email is NOT welcome and will go unanswered. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: Ajay Kalra on 11 Mar 2008 20:20 "Bob Moore" wrote in message news:jh5et3ped2q5mmuu8c8je4f7t3587ui7mv(a)4ax.com... > On Tue, 11 Mar 2008 14:45:46 -0400, Ajay Kalra wrote: > >>I think you need both, UNICODE and _UNICODE. > > Yes, one is for the Windows api, the other for the C runtime, Thats how I recall it. -- Ajay
From: Joseph M. Newcomer on 11 Mar 2008 20:54
You would typically want to first create a new configuration, e.g., "Unicode Debug", and create it from "Debug". Then delete the MBCS conditionals and add both UNICODE and _UNICODE, and build with that configuration. By doing it with a completely new configuration, you have a fallback when there are problems; you can build the ANSI version and test it. If you get the same failure, it isn't in the Unicode logic. Once you've got it debugged, do the same to build a Unicode Release. Also, you will have to change the main entry point; look up WinMain(a)16 in the MSDN help and follow the instructions there about changing the entry point name. joe On Tue, 11 Mar 2008 19:06:45 +0200, "Rami" <rami(a)goren.org.ir> wrote: >Thanks, >Following your detailed answer I looked again in the projects settings and >saw that all of them have "_MBCS" preprocessor definition. >Should I delete it or just add the "UNICODE" definition? >Thanks >Rami > >"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message >news:m95dt3l47s9gbigdkqj6qvv2jrlb61tgdi(a)4ax.com... >> This would be a Bad Idea. You have to convert all of it to use Unicode. >> Note that you >> can do part of the conversion gradually, but leave it as ANSI. For >> example, make sure all >> uses of 'char' are replaced by 'TCHAR', all uses of 'char *' by 'LPTSTR' >> and all uses of >> 'const char *' by LPCTSTR. Make sure all "..." and '.' literals have _T() >> around them. >> Replace all str... functions with their corresponding _tcs... functions. >> Watch out for >> confusions caused by thinking strlen or .GetLength() tell you the number >> of bytes, and fix >> them to do *sizeof(TCHAR) as part of the computation (and the inverse: >> byte counts >> disguised as character counts). Ditto for sizeof(). When you have all >> the code converted >> like this, then just build a new configuration in VS6 for Unicode Debug >> and one for >> Unicode Release, build in the Unicode Debug and start testing. This is by >> far the best >> approach. Don't try to convert one DLL to Unicode-only, and try to >> integrate it to an >> ANSI app; that way madness lies. >> joe > Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |