Click to See Complete Forum and Search --> : ASSERT failure when starting application


Brendan Cullen
April 30th, 1999, 09:20 AM
Hi,

When I launch my (DEBUG mode) executable, I get a debug assertion failure. It transpires that the problem is inside WinMain.cpp's AfxWinMain() function. In particular, the problem is with the ASSERT_VALID below :

CWinApp* pApp = AfxGetApp();

// AFX internal initialization
if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
goto InitFailure;

// App global initializations (rare)
ASSERT_VALID(pApp);
if (!pApp->InitApplication())
goto InitFailure;

I have createed my global application object. So why this error ? (If I launch my application in non-DEBUG mode it operates fine.)

Brendan