Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC
In the Release mode, my program runs fine, no major problems!
 
I am getting some runtime errors which are only occuring in the "Debug" configuration. The program compiles fine in Debug mode.
 
I see a message box ->
 

Debug Assertion Failed!
 
Program:
File: winocc.cpp
Line: 330
 

 
Sequentially debugging, led me to this in doctempl.cpp
 
	// create new from resource
	if (!pFrame->LoadFrame(m_nIDResource,
			WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,   // default frame styles
			NULL, &context))
	{
		TRACE(traceAppMsg, 0, "Warning: CDocTemplate couldn't create a frame.\n");
		// frame will be deleted in PostNcDestroy cleanup
		return NULL;
	}
 
This is where the assertion pops up.
 

In the linker, these are my additional library dependies. Is something wrong here?
 
d3d9.lib strmiids.lib ole32.lib winmm.lib psapi.lib user32.lib
 
Any idea what I am doing wrong?
Thanks.
Posted 20-Apr-13 8:28am
Edited 20-Apr-13 8:52am
v2
Comments
Matthew Faithfull at 20-Apr-13 16:33pm
   
Is your application multithreaded?
Sergey Alexandrovich Kryukov at 20-Apr-13 22:15pm
   
Even though it cannot help you much at the moment, it's good to understand that such things as "Debug mode" or "Release mode" do not exist. "Debug" and "Release" are no more then configuration which can have any names. But the configurations are different. In one of the configurations, tracing can be is disabled.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Goto the code line where the ASSERT is raised. this maybe the BOOL CWnd::ShowWindow(int nCmdShow) function. Set a break point (F9) and run the program (debug). At the first hit or some else the window handle may be invalid. Check the call stack and avoid the call of ShowWindow with an invalid window handle.
Regards.
  Permalink  
Comments
Amin Ur Rehman at 25-Apr-13 8:29am
   
it happens in my CMainFrame constructor actually :S nothing major happening there! But something is wrong, unable to narrow it down at the moment
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

delete all temp and build files and make a "rebuild all". Sometimes is an resource ID conflict the problem.
 
Or you must debug in the MFC-stuff Mad | :mad:
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Maybe problem In ID.maybe maybe.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100