show dialog in dll
-
i want to show a dialog in regular dll which is dynamicaly linked to mfc. the exported func is : //dynamicly extern "C" __declspec( dllexport ) void Trade1() { AFX_MANAGE_STATE(AfxGetStaticModuleState()) CDlgLogon dlg; dlg.DoModal (); } which does not work. if i set the dll staticly linked to mfc .it works well //staticly extern "C" __declspec( dllexport ) void Trade1() { CDlgLogon dlg; dlg.DoModal (); } is that means i can't use mfc in static library? gucy
-
i want to show a dialog in regular dll which is dynamicaly linked to mfc. the exported func is : //dynamicly extern "C" __declspec( dllexport ) void Trade1() { AFX_MANAGE_STATE(AfxGetStaticModuleState()) CDlgLogon dlg; dlg.DoModal (); } which does not work. if i set the dll staticly linked to mfc .it works well //staticly extern "C" __declspec( dllexport ) void Trade1() { CDlgLogon dlg; dlg.DoModal (); } is that means i can't use mfc in static library? gucy
Where is your dialog template? In the DLL or in the application. The second one (which you said works) would load it from the application, but the first one (which you said doesn't work) would try to load it from the DLL, and should work if the dialog template was in the DLL. If you want the first one to work, the dialog template must be in the DLL, not in the application. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
Where is your dialog template? In the DLL or in the application. The second one (which you said works) would load it from the application, but the first one (which you said doesn't work) would try to load it from the DLL, and should work if the dialog template was in the DLL. If you want the first one to work, the dialog template must be in the DLL, not in the application. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
If you use
AFX_MANAGE_STATE()
in the bottom one, does it still work? Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
If you use
AFX_MANAGE_STATE()
in the bottom one, does it still work? Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
Hmmm. I can't help much more - I'm not an expert on DLLs. Have a look at MFC technical note TN058 which explains module state switching in detail. As far as I can see, the first one should work :~ . Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"