Solved

stop in winhand for DEBUG version and OK  in Release version

Posted on 1997-05-18
6
513 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 113
maven archtype selection in eclipse 1 53
Unix Command -- Challenging  question 7 86
How to convert MFC::CString to UTF8 wchar_t* 10 139
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.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now