UNICODE support in an ATL project
-
If I add UNICODE support to an ATL dll, it can not compile as adding wWinMainCRTStartup into Setting->Link->Output->Entry-point symbol relates to MFC apps, and there is no such call when you have a dll project tol include the UNICODE. Or if you can direct me to any article on the net where somebody explains how to add UNICODE support to an ATL project. Thanks.
-
If I add UNICODE support to an ATL dll, it can not compile as adding wWinMainCRTStartup into Setting->Link->Output->Entry-point symbol relates to MFC apps, and there is no such call when you have a dll project tol include the UNICODE. Or if you can direct me to any article on the net where somebody explains how to add UNICODE support to an ATL project. Thanks.
If you are using Visual C++ to create the ATL dll, shouldn't it already create the entry point for you? It seems to me you just have to define UNICODE and _UNICODE in your preprocessor settings for the project. Deus caritas est
-
If you are using Visual C++ to create the ATL dll, shouldn't it already create the entry point for you? It seems to me you just have to define UNICODE and _UNICODE in your preprocessor settings for the project. Deus caritas est
That entry point is ANSI, not the UNICODE one. I do use _UNICODE and UNICODE in the preprocessor definitions, but when I build any of the Unicode configurations it doesn't show the Unicode letters properly. Of course, I have changed all the CString to use _T macros, all atoi to _ttoi, all A2BSTR to T2BSTR and similar, but to no avail. Thanks.
-
That entry point is ANSI, not the UNICODE one. I do use _UNICODE and UNICODE in the preprocessor definitions, but when I build any of the Unicode configurations it doesn't show the Unicode letters properly. Of course, I have changed all the CString to use _T macros, all atoi to _ttoi, all A2BSTR to T2BSTR and similar, but to no avail. Thanks.
The entry point function does not determine how your Unicode letters are being displayed. Are you trying to convert a char* to a Unicode string? Take a look at
MultiByteToWideChar
. This may be what you are looking for. I hope this helps. Deus caritas est -
If I add UNICODE support to an ATL dll, it can not compile as adding wWinMainCRTStartup into Setting->Link->Output->Entry-point symbol relates to MFC apps, and there is no such call when you have a dll project tol include the UNICODE. Or if you can direct me to any article on the net where somebody explains how to add UNICODE support to an ATL project. Thanks.
Not quite... :)
wWinMainCRTStartup
is the UNICODE entry point for the CRT,WinMainCRTStartup
is the ANSI version. They have nothing to do with MFC as far as your ATL project is concerned. Adding UNICODE support to an ATL project is not the same as BUILDING your project as UNICODE. I am under the impression that MFC and ATL projects already have most of the UNICODE support required (use ofTCHAR
-based characters/strings). When you build the UNICODE version of your project, you need to have the linker usewWinMainCRTStartup
as the entry point. Leave things the way they are/were for ANSI builds. Peace! -=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!) -
Not quite... :)
wWinMainCRTStartup
is the UNICODE entry point for the CRT,WinMainCRTStartup
is the ANSI version. They have nothing to do with MFC as far as your ATL project is concerned. Adding UNICODE support to an ATL project is not the same as BUILDING your project as UNICODE. I am under the impression that MFC and ATL projects already have most of the UNICODE support required (use ofTCHAR
-based characters/strings). When you build the UNICODE version of your project, you need to have the linker usewWinMainCRTStartup
as the entry point. Leave things the way they are/were for ANSI builds. Peace! -=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!)Thanks for your reply. The ATL project has some drawing and I used MFC, even if it bloats the code, as I am so used to MFC things in doing this. The reason for building it inside the ATL is that I can possibly use it later on under the .Net, avoiding all the problems and sluggishness of the .Net GDI+. Anyways, I know I have to use UNICODE support, but it just does not show it, for instance, if I set a name of the static control to some UNICODE name in Bosnian, then it would be properly displayed in the code editor (using Courier New CE), but when I compile it and test the control it just shows | instead of the characters, or something else. The wWinMainCRTStartup is the entry point for CRT, but the build fails if I define it, showing something like: "_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments; image may not run correctly" The dll crashes in run-time if I compile it that way. So the question is: what else I have to do to enable UNICODE character set in it. Thanks.