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: 281
  • Last Modified:

VC++ DLL and MFC

I'm working on an addin for a program that requires a very specific DLL entry point. However, I want to do the work using an MFC dialog. I can create a dialog just fine in the DLL's InitInstance() method but when I try from another method (which is called from the entry point function) I get a Debug Assertion failure. It appears that the dialog has no HWND associated with it. Can anyone tell me how I may conjure up a dialog box (using an existing template) that will work?

Thanks,

Russ...
0
Gahawn
Asked:
Gahawn
  • 2
1 Solution
 
hoabeoCommented:
I think you should add a call
     AFX_MANAGE_STATE(AfxGetStaticModuleState());
at the very beginning of the entry point function.

for example:

void Function()
{
     AFX_MANAGE_STATE(AfxGetStaticModuleState());
      // ... the rest of function goes here
}
0
 
GahawnAuthor Commented:
That's exactly what I needed. Where did you find this that I may look this sort of thing up next time?
0
 
hoabeoCommented:
See MFC Technical Notes 33 and 58 for additional details.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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