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. Can't create a DLL dialog box object

Can't create a DLL dialog box object

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionlearning
3 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.
  • K Offline
    K Offline
    King Coffee
    wrote on last edited by
    #1

    Hi I created a Dialog box class within a MFC share Regular DLL. I use the Resource Wizard to create the Dialog and Class Wizard to define the derived class. I'm exporting the class with the _declspec(dllexport) storage class type specifier. When I try to create an object of that derived Dialog box class in the client application... the object pointer is NULL. I get no errors. The DLL is loaded at load-time, the DLL Library is included in the linker. Do you know what step(s) I might be leaving out ?? One person suggested adding the AFX_MANAGE_STATE macro... but, none of the CDialog base functions are being re-defined. So, I'm exporting the Dialog Box functions indirectly... adding the AFX_MANAGE_STATE macro at the begain of the exported functions is not feasible. Besides, I create a Regular MFC DLL function that used a device context pointer and CBrush class... and I did not include the AFX_MANAGE_STATE macro. Thx, King

    S 1 Reply Last reply
    0
    • K King Coffee

      Hi I created a Dialog box class within a MFC share Regular DLL. I use the Resource Wizard to create the Dialog and Class Wizard to define the derived class. I'm exporting the class with the _declspec(dllexport) storage class type specifier. When I try to create an object of that derived Dialog box class in the client application... the object pointer is NULL. I get no errors. The DLL is loaded at load-time, the DLL Library is included in the linker. Do you know what step(s) I might be leaving out ?? One person suggested adding the AFX_MANAGE_STATE macro... but, none of the CDialog base functions are being re-defined. So, I'm exporting the Dialog Box functions indirectly... adding the AFX_MANAGE_STATE macro at the begain of the exported functions is not feasible. Besides, I create a Regular MFC DLL function that used a device context pointer and CBrush class... and I did not include the AFX_MANAGE_STATE macro. Thx, King

      S Offline
      S Offline
      suiram40
      wrote on last edited by
      #2

      try this hRes= LoadLibrary("dllwheredlgis.dll"); if(hRes) AfxSetResourceHandle(hRes);

      K 1 Reply Last reply
      0
      • S suiram40

        try this hRes= LoadLibrary("dllwheredlgis.dll"); if(hRes) AfxSetResourceHandle(hRes);

        K Offline
        K Offline
        King Coffee
        wrote on last edited by
        #3

        Hi I try adding that code to the client app and hRes is a NULL HINSTANCE pointer. also, I'm not sure where the problem lies, in the DLL or the Client ??

        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