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. Use of Non-Unicode DLL in Unicode project

Use of Non-Unicode DLL in Unicode project

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • C Offline
    C Offline
    chevu
    wrote on last edited by
    #1

    Hi, Lets say, I am having Vendor dll and it is non-unicode. I want to use this dll in my Application and it is unicode. DLL is built using SDK functions such way that I cannot make is Unicode, same with Application it cannot build without unicode (frame work dependencies). Both of them are using CString. Is there any way possible by which I can use this dll in my application without changing their nature? Please let me know if further clarification needed. Thanks in advance.

    A A 2 Replies Last reply
    0
    • C chevu

      Hi, Lets say, I am having Vendor dll and it is non-unicode. I want to use this dll in my Application and it is unicode. DLL is built using SDK functions such way that I cannot make is Unicode, same with Application it cannot build without unicode (frame work dependencies). Both of them are using CString. Is there any way possible by which I can use this dll in my application without changing their nature? Please let me know if further clarification needed. Thanks in advance.

      A Offline
      A Offline
      Aescleal
      wrote on last edited by
      #2

      It should be easy enough. Just make sure when calling the vendor supplied DLL to use explicit specialisations of CStringT e.g. CStringT< char, ChTraitsCRT >. It might be a good idea to use a typedef for this. Oh, one other thing - make sure that around including the header for the library TCHAR is defined as char and not wchar_t or the functions won't link properly. Cheers, Ash PS: Looks like there are already typedefs in MFC for this sort of thing. Have a look in Alain's answer below for their names!

      modified on Thursday, October 28, 2010 8:28 AM

      1 Reply Last reply
      0
      • C chevu

        Hi, Lets say, I am having Vendor dll and it is non-unicode. I want to use this dll in my Application and it is unicode. DLL is built using SDK functions such way that I cannot make is Unicode, same with Application it cannot build without unicode (frame work dependencies). Both of them are using CString. Is there any way possible by which I can use this dll in my application without changing their nature? Please let me know if further clarification needed. Thanks in advance.

        A Offline
        A Offline
        Alain Rist
        wrote on last edited by
        #3

        Hi, From VS2003 the MFC (or ATL) CString classes are specializations of CStringT: see http://msdn.microsoft.com/en-us/library/5bzxfsea(VS.71).aspx[^] Explicitly use CStringW for your framework related code and CStringA for interaction with your DLL. cheers, AR

        When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)

        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