Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Draw and samples / sample run error(VC2008)

sample run error(VC2008)

sample run error(VC2008)
lanhan 2012/06/30 10:42
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: c:\OpenCASCADE6.5.3\samples\mfc\win32\vc9\bind\Geometry.exe
File: c:\opencascade6.5.3\samples\mfc\common\winmain.cpp
Line: 76

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
 
 
Latest news
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!
  • Open CASCADE Technology 6.5.4 is available for download!

  • © OPEN CASCADE 2000 - 2013  |  Search  |  Contacts   |  Site map