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. How to get CDialog objects from plugin DLLs

How to get CDialog objects from plugin DLLs

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

    Hy. I'm developing a plugin based application. My problem is that i need to define some dialogs in the plugins that later i can use from the main application to configure each plugin (something like Winamp3's Config Dialog). If i export pointers to CPropertyPage's from the plugins and use the AddPage of the CPropertySheet in the main app, everything works well, but if i export pointers to CDialog and try to position such a dialog in another dialog created by the main application, it gives me some errors at run time. Anybody has a clue on how to create the dialogs in the plugins so i can still handle the controls from that dialog in the plugin but still be able to position it in another dialog in the main application ???

    R 1 Reply Last reply
    0
    • A albuemil

      Hy. I'm developing a plugin based application. My problem is that i need to define some dialogs in the plugins that later i can use from the main application to configure each plugin (something like Winamp3's Config Dialog). If i export pointers to CPropertyPage's from the plugins and use the AddPage of the CPropertySheet in the main app, everything works well, but if i export pointers to CDialog and try to position such a dialog in another dialog created by the main application, it gives me some errors at run time. Anybody has a clue on how to create the dialogs in the plugins so i can still handle the controls from that dialog in the plugin but still be able to position it in another dialog in the main application ???

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      Are the plug-ins being dynamically linked or statically linked to? If dynamically (i.e. LoadLibrary) then when the dialog is created (Create/DoModal()), you need to make sure that the resources of the DLL are setup as the default at that time. Take a look at the AFX_MANAGE_STATE() macro or the AfxSetResourceHandle() commands which will allow you to change to the correct resources when the dialog is created from its resources. Also, you may be interested in my plug-in article thats listed in the Projects/Libraries section here at CP. Roger Allen Sonork 100.10016 WHats brown and sticky? A stick or some smelly stuff!

      A 1 Reply Last reply
      0
      • R Roger Allen

        Are the plug-ins being dynamically linked or statically linked to? If dynamically (i.e. LoadLibrary) then when the dialog is created (Create/DoModal()), you need to make sure that the resources of the DLL are setup as the default at that time. Take a look at the AFX_MANAGE_STATE() macro or the AfxSetResourceHandle() commands which will allow you to change to the correct resources when the dialog is created from its resources. Also, you may be interested in my plug-in article thats listed in the Projects/Libraries section here at CP. Roger Allen Sonork 100.10016 WHats brown and sticky? A stick or some smelly stuff!

        A Offline
        A Offline
        albuemil
        wrote on last edited by
        #3

        Hy. The plugins are dinamically created (i load them with LoadLibrary) and all the plugins are MFC Extension DLL. I found another way, it's working perfectly, i use a component named : EzOptionsDlg wich uses CPropertyPages, exactly what worked for me. (you can find it here at C.P. http://www.codeproject.com/dialog/ezoptionsdlg.asp. My only problem with this is that i have to make shure each plugin uses different resource numbers ore the wrong dialogs will appear. Anyway, i solved the problem, i wanted to make something similar to this. Thanx for the help.

        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