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. MFC and DLL

MFC and DLL

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 2 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.
  • S Offline
    S Offline
    SylL
    wrote on last edited by
    #1

    Hello I use MFC in a DLL. When linking, i get a messinge telling that _DllMain@12 symbol is already defined in a library nafxcwd.lib and there is a conflict with the symbol defined in my program. Isn't it possible to use MFC in a DLL ? If possible, how to do it ? Thank you

    D S 2 Replies Last reply
    0
    • S SylL

      Hello I use MFC in a DLL. When linking, i get a messinge telling that _DllMain@12 symbol is already defined in a library nafxcwd.lib and there is a conflict with the symbol defined in my program. Isn't it possible to use MFC in a DLL ? If possible, how to do it ? Thank you

      D Offline
      D Offline
      Doug Mitchell
      wrote on last edited by
      #2

      See this

      S 2 Replies Last reply
      0
      • D Doug Mitchell

        See this

        S Offline
        S Offline
        SylL
        wrote on last edited by
        #3

        Thank you, but I hava already tried this. This is not exactly my problem. In your example, there is a conflict between two libraries, so you have to include them in the right order. For instance ' mfcs42d.lib(dllmodul.obj): error LNK2005: _DllMain@12 already defined in msvcrtd.lib(dllmain.obj)' In my problem, the symbol is already defined in prog.obj (which must be the object code associated with my code prog.cpp) : 'msvcrtd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in prog.obj' As I'm developping a DLL, I think there is a conflict between my DllMain and the one from the library

        1 Reply Last reply
        0
        • D Doug Mitchell

          See this

          S Offline
          S Offline
          SylL
          wrote on last edited by
          #4

          I have (perhaps) solved the problem by including my DllMain in a namespace. The DLL is compiled and linked, but I can't use my dialog : CDlgParamSynchro* dlg = new CDlgParamSynchro (CWnd::FromHandle(this->h_fen)) ; dlg->DoModal() ; (this->h_fen is a HWND on a window) The dialog is initialized then display but frozen

          1 Reply Last reply
          0
          • S SylL

            Hello I use MFC in a DLL. When linking, i get a messinge telling that _DllMain@12 symbol is already defined in a library nafxcwd.lib and there is a conflict with the symbol defined in my program. Isn't it possible to use MFC in a DLL ? If possible, how to do it ? Thank you

            S Offline
            S Offline
            SylL
            wrote on last edited by
            #5

            I've solved my problem by including my DllMain in a namespace

            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