Solved

stop in winhand for DEBUG version and OK  in Release version

Posted on 1997-05-18
6
522 Views
Last Modified: 2013-11-19
Hi,have a nice day.
A project runs through winhand.cpp in OnTimer.
Here is winhand.cpp.
void CHandleMap::RemoveHandle(HANDLE h)
{
#ifdef _DEBUG
// make sure the handle entry is consistent
CObject* pTemp;
if (LookupTemporary(h, pTemp))
{
  // temporary objects must have correct handle values
  HANDLE* ph = (HANDLE*)(pTemp + 1);  // after CObject
  ASSERT(ph[0] == h);  //<----- (****)

When the project runs in DEBUG model,
after some minutes, assertion failed in (****)
But in RELEASE model, it is OK.
More informations are DEBUG model,ph[0] and h are
increasing when running and I work in Visual C++ 1.0.
The question is
1. Is it truely OK when RELEASE version?
2. How can I debug the problem when DEBUG version?
Any suggestions are useful for me. Thanks.
0
Comment
Question by:mathematics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 

Author Comment

by:mathematics
ID: 1301628
Edited text of question
0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1301629
1. Is it truely OK when RELEASE version?
No, I don't think so. Never ignore ASSERT failure. It is likely that there is a bug in your program.

2. How can I debug the problem when DEBUG version?
It is not trivial. I think the bug is related to some code about CWnd (create, destroy). I suggest to reduce your code, remove the unrelated code for the time being. Then, it is easier to debug.

0
 

Author Comment

by:mathematics
ID: 1301630
More informations
AfxSig_vv->
CView::OnPain->
CPaintDC::~CPaintDC->
CDC::ReleaseAttribDC->
CHandleMap::RemoveHandle
the ClientDC in
   void CSplitterWnd::OnPaint()
deleted when completed OnPaint.
More Question is
Can we run OnTimer conatined a CSpliiterWnd?
(Because a splitter rect drawn in the middle of views.
 And the drawing action can't do in timing,I think!)
Hope help!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:chensu
ID: 1301631
It looks like the exception is caused by something about CDC. Do you use CClientDC in CSplitterWnd::OnPaint()? Use CPaintDC instead of CClientDC in OnPaint().

You can perform some action about CSplitterWnd in OnTimer.

0
 

Author Comment

by:mathematics
ID: 1301632
Recently,I change memory model of the project with large.
Then it's OK when DEBUG version.
I don't know why. If you know, hope tell me. Thanks.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1301633
If some errors disappear when changing memory model, there are some possibilities. In your case, it is likely that there are too much data that medium memory model cannot handle, and DEBUG version has more data than RELEASE version.


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question