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