Click here to Skip to main content
15,895,740 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Vector elements and the heap...or the stack... Pin
Mike the Red11-Jul-09 8:53
Mike the Red11-Jul-09 8:53 
GeneralRe: Vector elements and the heap...or the stack... Pin
Stuart Dootson11-Jul-09 8:56
professionalStuart Dootson11-Jul-09 8:56 
QuestionDialogBox function Pin
dipuks10-Jul-09 12:36
dipuks10-Jul-09 12:36 
AnswerRe: DialogBox function Pin
«_Superman_»10-Jul-09 15:59
professional«_Superman_»10-Jul-09 15:59 
QuestionToolbar-like custom draw buttons Pin
tiresias210-Jul-09 10:00
tiresias210-Jul-09 10:00 
QuestionAdding BigInt's Pin
TannerB10-Jul-09 9:35
TannerB10-Jul-09 9:35 
AnswerRe: Adding BigInt's Pin
josda100010-Jul-09 9:57
josda100010-Jul-09 9:57 
Question"Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 8:00
james_bond10-Jul-09 8:00 
Problem: "Debug Assert Error" in VC++.NET

1) I have a Clistctrl object placed in a dialog.
2) An mfc worker thread calls a display function to update the Clistctrl.
3) The display function uses methods such as Clistctrl::setitemtext etc to update the Clistctrl display.

The application works fine.
--------------

However ONLY when I close the application

1) i get a "debug assert error".
2) I've noticed that the mfc worker thread crashes.
--------------

This "debug assert error" happens (I believe) because:

1) When the application closes, the Clistctrl object is destroyed.
2) But the display function that is called by the worker thread continues
accessing the destroyed Clistctrl object by calling the Clistctrl::setitemtext function.
3) Thus the thread crashes leading to the debug assert error.

-------------
Question:
1) Am i correct in assuming the cause of the "debug assert error" ? If not, correct me please.
2) How do i fix the above problem ?

Any help will be greatly appreciated
AnswerRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 8:33
josda100010-Jul-09 8:33 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 10:56
james_bond10-Jul-09 10:56 
AnswerRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 11:07
josda100010-Jul-09 11:07 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
james_bond10-Jul-09 14:05
james_bond10-Jul-09 14:05 
GeneralRe: "Debug Assert Error" in VC++.NET Pin
josda100010-Jul-09 16:02
josda100010-Jul-09 16:02 
AnswerRe: "Debug Assert Error" in VC++.NET Pin
Stuart Dootson10-Jul-09 8:35
professionalStuart Dootson10-Jul-09 8:35 
QuestionRelease Mode issue Pin
dipuks10-Jul-09 7:30
dipuks10-Jul-09 7:30 
AnswerRe: Release Mode issue Pin
Stuart Dootson10-Jul-09 8:31
professionalStuart Dootson10-Jul-09 8:31 
AnswerRe: Release Mode issue Pin
Cyrilix10-Jul-09 11:29
Cyrilix10-Jul-09 11:29 
QuestionCD Drive functions Pin
dipuks10-Jul-09 7:27
dipuks10-Jul-09 7:27 
AnswerRe: CD Drive functions Pin
David Crow10-Jul-09 8:00
David Crow10-Jul-09 8:00 
Questiondefault parameters - functions Pin
john john mackey10-Jul-09 6:41
john john mackey10-Jul-09 6:41 
AnswerRe: default parameters - functions Pin
krmed10-Jul-09 7:01
krmed10-Jul-09 7:01 
GeneralRe: default parameters - functions Pin
john john mackey10-Jul-09 7:34
john john mackey10-Jul-09 7:34 
GeneralRe: default parameters - functions Pin
David Crow10-Jul-09 8:02
David Crow10-Jul-09 8:02 
AnswerRe: default parameters - functions Pin
josda100010-Jul-09 8:05
josda100010-Jul-09 8:05 
GeneralRe: default parameters - functions Pin
John R. Shaw10-Jul-09 8:09
John R. Shaw10-Jul-09 8:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.