Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. UNICODE support in an ATL project

UNICODE support in an ATL project

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    damir_tk
    wrote on last edited by
    #1

    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.

    A J 2 Replies Last reply
    0
    • D damir_tk

      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.

      A Offline
      A Offline
      Andy Moore
      wrote on last edited by
      #2

      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

      D 1 Reply Last reply
      0
      • A Andy Moore

        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

        D Offline
        D Offline
        damir_tk
        wrote on last edited by
        #3

        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.

        A 1 Reply Last reply
        0
        • D damir_tk

          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.

          A Offline
          A Offline
          Andy Moore
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • D damir_tk

            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.

            J Offline
            J Offline
            James R Twine
            wrote on last edited by
            #5

            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 of TCHAR-based characters/strings).    When you build the UNICODE version of your project, you need to have the linker use wWinMainCRTStartup 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!)

            D 1 Reply Last reply
            0
            • J James R Twine

              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 of TCHAR-based characters/strings).    When you build the UNICODE version of your project, you need to have the linker use wWinMainCRTStartup 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!)

              D Offline
              D Offline
              damir_tk
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups