Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AFX_MANAGE_STATE(AfxGetStaticModuleState());

90 views
Skip to first unread message

David Wong

unread,
Mar 3, 2002, 6:05:37 PM3/3/02
to
I have an EXE which calls a function in an MFC dll
"MembersDll_MembershipList"(see below) the CMEMBERSHIP_LIST is derived from
a dialog in a another MFC dll(MFC extension dll). The problem is that the
resource for the dialog cannot be found.

Any solutions? Workarounds.

Thanks.

PS : Works fine when you have an MFC exe calling into the MFC extension dll.

extern "C" __declspec( dllexport ) ULONG MembersDll_MembershipList() {

AFX_MANAGE_STATE(AfxGetStaticModuleState());

CMEMBERSHIP_LIST CMembershipList;

CMembershipList.DoModal();

return false;
}

David Wong

unread,
Mar 3, 2002, 8:13:33 PM3/3/02
to
I think the only way to get around this is to have a MFC EXE?

Can anyone confirm this.

Thanks.

"David Wong" <da...@jetzsystems.com> wrote in message
news:#hAZpewwBHA.360@tkmsftngp07...

Joël Badoil

unread,
Mar 4, 2002, 1:03:02 PM3/4/02
to

>-----Original Message-----
>I think the only way to get around this is to have a MFC
EXE?
>
>Can anyone confirm this.
>
No, it works, I did it.


extern long CreateInDll()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CMsgDlg* pMsgDlg = new CMsgDlg;
pMsgDlg->DoModal();
return 1;
}

I don't know what's wrong with you. Do you really have the
resources ?

David Wong

unread,
Mar 5, 2002, 7:25:54 PM3/5/02
to
You have to do the call a exported function in the Extension Dll from the
InitInstance of the Regular dll that has the

extern "C" __declspec(dllexport) void InitMyEXTDLL()
{
// create a new CDynLinkLibrary for this app
new CDynLinkLibrary(CMyDLL);

// add other initialization here
}

You can't do it in the InitInstance of the EXE.


"David Wong" <da...@jetzsystems.com> wrote in message

news:#2NSJmxwBHA.2516@tkmsftngp04...

0 new messages