Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

stop in winhand for DEBUG version and OK  in Release version

Posted on 1997-05-18
6
Medium Priority
?
531 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 200 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

722 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