Solved

Help !!! DLL with resource !!!

Posted on 1998-06-11
3
189 Views
Last Modified: 2013-11-20
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
Comment
Question by:surenechan
3 Comments
 
LVL 1

Accepted Solution

by:
motigust earned 0 total points
ID: 1317856
you should add the following code, at the begining of each function in the DLL:
      AFX_MANAGE_STATE(AfxGetStaticModuleState());

0
 
LVL 1

Expert Comment

by:chacko
ID: 1317857
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
 

Author Comment

by:surenechan
ID: 1317858
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now