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

Assertions during DLL load

164 views
Skip to first unread message

Drew

unread,
Dec 17, 2009, 5:37:48 PM12/17/09
to
I have an out-of-proc ATL server w/MFC support using VS2008 SP1. When the
DLL is registered or instatiatiated by a client I receive two assertions
during DLL_PROCESS_ATTACH.

The following line in dllinit.cpp line 587 (AfxCoreInitModule()) is causing
the first assertion failiure:

ASSERT(AfxGetModuleState() != AfxGetAppModuleState());

If I ignore this the following line in dllmodul.cpp line 135
(InternalDllMain()) is causing the second assertion failure:

VERIFY(AfxSetModuleState(AfxGetThreadState()->m_pPrevModuleState) ==
&afxModuleState);

Is this something that can be prevented?

Thanks,
Drew


Drew

unread,
Dec 17, 2009, 6:42:45 PM12/17/09
to
Oops. Make that an in-proc ATL server.

"Drew" <d...@dam.com> wrote in message
news:uuf3kn2f...@TK2MSFTNGP05.phx.gbl...

David Ching

unread,
Dec 17, 2009, 8:21:58 PM12/17/09
to
"Drew" <d...@dam.com> wrote in message
news:OpzL3L3f...@TK2MSFTNGP06.phx.gbl...

> Oops. Make that an in-proc ATL server.
>

Are you using MFC DLL or static linking? Are you sure you have defined
_USRDLL, etc. appropriately?

-- David

Drew

unread,
Dec 18, 2009, 11:05:36 AM12/18/09
to

"David Ching" <d...@remove-this.dcsoft.com> wrote in message
news:O6H7$B4fKH...@TK2MSFTNGP04.phx.gbl...

I am using MFC DLL. I didn't have _USRDLL defined but it didn't make any
difference. I did (and do) have _AFXDLL and _WINDLL defined. Am I maybe
mixing and matching these incorrectly?

Thanks,
Drew


David Ching

unread,
Dec 19, 2009, 9:12:17 AM12/19/09
to
"Drew" <d...@dam.com> wrote in message
news:ea20Cx$fKHA...@TK2MSFTNGP04.phx.gbl...

> I am using MFC DLL. I didn't have _USRDLL defined but it didn't make any
> difference. I did (and do) have _AFXDLL and _WINDLL defined. Am I maybe
> mixing and matching these incorrectly?
>

What I would do is use AppWizard to create a new dummy ActiveX control and
make sure you don't have the same assertion problem with this. Then copy
your code into this new project.

-- David

0 new messages