For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
中止(A) 重试(R) 忽略(I)
---------------------------
lanhan
2012/06/30 10:45
here pApp is NULL:
CWinApp* pApp = AfxGetApp();
MFC:
int AFXAPI AfxWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
#ifdef DISPLAYCONSOLE
// Redirection of standard output to console
int hCrt; BOOL rep; FILE *hf;
_SYSTEM_INFO lps;
GetSystemInfo(&lps);
rep = AllocConsole();
hCrt = _open_osfhandle((long) GetStdHandle(STD_OUTPUT_HANDLE),_O_TEXT);
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
// stop the buffer on stdout
// int i = setvbuf( stdout, NULL, _IONBF, 0 );
// filebuf ff(hCrt);
// cout = &ff;
cout<<"This Debug Window is defined in WinMain.cpp and will disappear in release mode"<<endl;
#endif // DISPLAYCONSOLE // By Matra
// create log file for all OCC messages
// Message::DefaultMessenger()->AddPrinter (new Message_PrinterOStream ("OCCSampleRun.log", Standard_False));
ASSERT(hPrevInstance == NULL);
int nReturnCode = -1;
CWinApp* pApp = AfxGetApp();
// error here:pApp=NULL
Forum supervisor
2012/07/02 10:09
Dear lanhan,
The problem is not reproduced as in Debug as in Release mode.
'Geometry' sample starts and works properly.
Check, please building process once again (see for details 'readme.txt' file in root directory of
'mfc' based samples). Also I suggest you to check the built sample with Dependency Walker.
Regards