Solved

stop in winhand for DEBUG version and OK  in Release version

Posted on 1997-05-18
6
512 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
Comment Utility
Edited text of question
0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 60
xyBalance chalenge 58 88
ORA-01403: no data found 43 82
Detect CR LF to each line 12 135
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

12 Experts available now in Live!

Get 1:1 Help Now