From: malhenry on
I am running the debugger in VC++ 6.0.

It says the assert is on the following line (27):

{ ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }

This happens when one of my dlls is executing.

I tried adding the following as a global in the main code, but this did not
help.
CWinApp MyApp("xxxx"); // attempted to remove assert

Also, I use multiple dlls. One of the dll's uses MFC (not the new
problematic one) and is a normal dynamically linked dll. (use MFC shared dll
and NO DllMain).

Any ideas on how to fix the assert?

TIA!




From: Scot T Brennecke on
Is it possible that you need to use the
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
in your exported DLL function that ends up calling (directly or
indirectly) AfxGetAppName?

In article <BBA3AFA2-D9D6-43B4-BF04-D5DA1FC48467(a)microsoft.com>,
malhenry(a)discussions.microsoft.com says...
> I am running the debugger in VC++ 6.0.
>
> It says the assert is on the following line (27):
>
> { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
>
> This happens when one of my dlls is executing.
>
> I tried adding the following as a global in the main code, but this did not
> help.
> CWinApp MyApp("xxxx"); // attempted to remove assert
>
> Also, I use multiple dlls. One of the dll's uses MFC (not the new
> problematic one) and is a normal dynamically linked dll. (use MFC shared dll
> and NO DllMain).
>
> Any ideas on how to fix the assert?
From: malhenry on
Thanks for your post.

I fixed the problem with the following two changes:
Change Project Settings > General from Not using MFC to Use MFC in a Shared
DLL
in my dll that had the assertion failure
and
added the following line as a Global in the main .cpp file:
CWinApp MyApp("xx"); // This removes Assertion failure on afxwin1.inl




"Scot T Brennecke" wrote:

> Is it possible that you need to use the
> AFX_MANAGE_STATE( AfxGetStaticModuleState() );
> in your exported DLL function that ends up calling (directly or
> indirectly) AfxGetAppName?
>
> In article <BBA3AFA2-D9D6-43B4-BF04-D5DA1FC48467(a)microsoft.com>,
> malhenry(a)discussions.microsoft.com says...
> > I am running the debugger in VC++ 6.0.
> >
> > It says the assert is on the following line (27):
> >
> > { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
> >
> > This happens when one of my dlls is executing.
> >
> > I tried adding the following as a global in the main code, but this did not
> > help.
> > CWinApp MyApp("xxxx"); // attempted to remove assert
> >
> > Also, I use multiple dlls. One of the dll's uses MFC (not the new
> > problematic one) and is a normal dynamically linked dll. (use MFC shared dll
> > and NO DllMain).
> >
> > Any ideas on how to fix the assert?
>