What is "afxContextIsDLL" ? I got this error!  
Author Message
googlinggoogler





PostPosted: Wed Jul 28 11:30:40 CDT 2004 Top

MFC >> What is "afxContextIsDLL" ? I got this error!

hi,all
I have a exe, unicode version and non MFC, it will load a dll(Unicode version) when it starts up. When I exit the program, I got a access violation error.
The exe app is like :
BOOL CMyApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic()
#endif
...............
..... Load my dll and run it, the main interface is in this dll
..... Free the dll
return FALSE;
}

And then I get the error at here:
int CWinApp::ExitInstance()
{
if (m_pCmdInfo == NULL ||m_pCmdInfo->m_nShellCommand != CCommandLineInfo::AppUnregister)
{
if (!afxContextIsDLL)//Error occurs here, in watch win, it shows this symbol is not found.
SaveStdProfileSettings();
}

// Cleanup DAO if necessary
if (m_lpfnDaoTerm != NULL)
{
// If a DLL, YOU must call AfxDaoTerm prior to ExitInstance
ASSERT(!afxContextIsDLL);
(*m_lpfnDaoTerm)();
}

return m_msgCur.wParam; // returns the value from PostQuitMessage
}

So what is afxContextIsDLL?
Thanks

Visual Studio53  
 
 
CheckAbdoul





PostPosted: Wed Jul 28 11:30:40 CDT 2004 Top

MFC >> What is "afxContextIsDLL" ? I got this error! See if the following KB article helps you

PRB: Assertion or Problems Using DAO in a DLL
http://support.microsoft.com/?id=149889

--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------



> hi,all
> I have a exe, unicode version and non MFC, it will load a dll(Unicode
version) when it starts up. When I exit the program, I got a access
violation error.
> The exe app is like :
> BOOL CMyApp::InitInstance()
> {
> AfxEnableControlContainer();
> #ifdef _AFXDLL
> Enable3dControls();
> #else
> Enable3dControlsStatic()
> #endif
> ...............
> ..... Load my dll and run it, the main interface is in this dll
> ..... Free the dll
> return FALSE;
> }
>
> And then I get the error at here:
> int CWinApp::ExitInstance()
> {
> if (m_pCmdInfo == NULL ||m_pCmdInfo->m_nShellCommand !=
CCommandLineInfo::AppUnregister)
> {
> if (!afxContextIsDLL)//Error occurs here, in watch win, it shows this
symbol is not found.
> SaveStdProfileSettings();
> }
>
> // Cleanup DAO if necessary
> if (m_lpfnDaoTerm != NULL)
> {
> // If a DLL, YOU must call AfxDaoTerm prior to ExitInstance
> ASSERT(!afxContextIsDLL);
> (*m_lpfnDaoTerm)();
> }
>
> return m_msgCur.wParam; // returns the value from PostQuitMessage
> }
>
> So what is afxContextIsDLL?
> Thanks