Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Help !!! DLL with resource !!!

Hi,
   I've make a dialog class together with the dialog resource and I want to put all of it together to generate a MFC extension DLL so that the code together with the resources can be reused by others easily .
   However , the test program see an invalid template name when calling CDialog::Create during run-time.
   Can you tell me what's wrong ?
0
surenechan
Asked:
surenechan
1 Solution
 
motigustCommented:
you should add the following code, at the begining of each function in the DLL:
      AFX_MANAGE_STATE(AfxGetStaticModuleState());

0
 
chackoCommented:
Try regular DLL. Your problem seems to be the thread can not locate the application it belongs to. If ur dialog is extension DLL, your dialog creation function must be connected to an application instance.
0
 
surenechanAuthor Commented:
Yes, the test program can work properly now provided it was complied in Shared MFC DLL .
But, it seems can't get the proper instance handle of resource when complied in Static MFC Lib after the application entering the dll invoking the modal dialog.
Can you tell me why ?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now