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. ATL / WTL / STL
  4. How to use multi byte character set in vs2008 ATL

How to use multi byte character set in vs2008 ATL

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helptutorialquestion
3 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.
  • R Offline
    R Offline
    Robe
    wrote on last edited by
    #1

    when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []' then try to modify: form STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) to STDAPI DllInstall(BOOL bInstall, LPCSTR pszCmdLine) compile: error C2733: second C linkage of overloaded function 'DllInstall' not allowed any ideas? thanks!

    modified on Friday, April 11, 2008 12:30 AM

    N 1 Reply Last reply
    0
    • R Robe

      when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []' then try to modify: form STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) to STDAPI DllInstall(BOOL bInstall, LPCSTR pszCmdLine) compile: error C2733: second C linkage of overloaded function 'DllInstall' not allowed any ideas? thanks!

      modified on Friday, April 11, 2008 12:30 AM

      N Offline
      N Offline
      Nathan Holt at EMOM
      wrote on last edited by
      #2

      Robe wrote:

      when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []'

      Another way to solve your problem would be to use the system function MultibyteToWideChar to convert your message to unicode when you call DllInstall. (If you're in charge of calling it, that is.) The other solution I can think of would be to just use a unicode project, depending on how much you would have to change for it. Nathan

      D 1 Reply Last reply
      0
      • N Nathan Holt at EMOM

        Robe wrote:

        when create atl project, then set multi-byte character, compile, I got error: DllInstall: error C2440: 'initializing' : cannot convert from 'const char [5]' to 'const wchar_t []'

        Another way to solve your problem would be to use the system function MultibyteToWideChar to convert your message to unicode when you call DllInstall. (If you're in charge of calling it, that is.) The other solution I can think of would be to just use a unicode project, depending on how much you would have to change for it. Nathan

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

        You can change the static const wchar_t szUserSwitch[] = _T("user"); with static const wchar_t szUserSwitch[] = L"user"; regards

        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