Extension dll implicitly linking with another extension dll

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have an extension dll that implicitly links with a second extension
dll. All seems to work fine, however, in the second dll if I call
AfxGetApp() it returns NULL. I'm trying to determine why the resource
chain isn't being set in the second dll.

An app links with the first dll, and the first dll links with the
second dll. If I call AfxGetApp() in the first dll it returns me the
correct info, but if then the very next line (in the first dll) I call
a function insidde the second dll, which then calls AfxGetApp(), it
simply returns NULL.


I have even tried putting AFX_MANAGE_STATE(AfxGetModuleState()); as the
first line in my functions but that doesn't do anything.


Any ideas as to why the resource chain isn't being set when the first
extension dll implicitly loads the second dll???? (the dllmain
discusses an issue with a regular dll trying to implicitly link with an
extension dll, but doesn't say anything about an extension dll trying
to load another extensiondll).

Any ideas appreciated,
Mike

.



Relevant Pages

  • Re: calls to unmanaged dll to create a socket result in debug assertio
    ... For example, it assumes that in an extension DLL, you ... should be getting the handle of the main app from AfxGetInstanceHandle. ... the instance handle of the MFC app it is extending, that app isn't there, and it fails. ...
    (microsoft.public.vc.mfc)
  • Re: Wireless Provisioning Services and IAS Authorization DLL
    ... support to our service :-) ... | Subject: Re: Wireless Provisioning Services and IAS Authorization DLL ... |> customers needs to have somebody debug their own IAS Extension DLL then ...
    (microsoft.public.win32.programmer.networks)
  • Re: calls to unmanaged dll to create a socket result in debug assertio
    ... For example, it assumes that in an extension DLL, you ... the instance handle of the MFC app it is extending, that app isn't there, and it fails. ... Within the unmanaged code, in the DllMain procedure, I see the following ...
    (microsoft.public.vc.mfc)
  • Re: FAO J Navia
    ... following is the stack dump for the errors. ... I am also giving the code for the dll along with this mail... ... DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) ... If this Extension DLL is being implicitly linked to by ...
    (comp.lang.c)
  • FAO J Navia
    ... following is the stack dump for the errors. ... I am also giving the code for the dll along with this mail... ... DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) ... If this Extension DLL is being implicitly linked to by ...
    (comp.lang.c)