?
Solved

VC++ DLL and MFC

Posted on 2003-03-06
3
Medium Priority
?
274 Views
Last Modified: 2010-04-17
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
Comment
Question by:Gahawn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
hoabeo earned 300 total points
ID: 8086839
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
 
LVL 1

Author Comment

by:Gahawn
ID: 8086885
That's exactly what I needed. Where did you find this that I may look this sort of thing up next time?
0
 
LVL 1

Expert Comment

by:hoabeo
ID: 8086987
See MFC Technical Notes 33 and 58 for additional details.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Progress
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question