Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get the total sectors of physical disk Pin
bghuang11-Oct-05 2:47
bghuang11-Oct-05 2:47 
GeneralRe: How to get the total sectors of physical disk Pin
Devendra Vaja14-Oct-05 23:36
Devendra Vaja14-Oct-05 23:36 
QuestionException while deletion -- scalar deleting destructor Pin
Divick10-Oct-05 23:50
Divick10-Oct-05 23:50 
AnswerRe: Exception while deletion -- scalar deleting destructor Pin
Roger Stoltz11-Oct-05 0:18
Roger Stoltz11-Oct-05 0:18 
GeneralRe: Exception while deletion -- scalar deleting destructor Pin
Divick11-Oct-05 4:47
Divick11-Oct-05 4:47 
GeneralRe: Exception while deletion -- scalar deleting destructor Pin
Roger Stoltz11-Oct-05 7:02
Roger Stoltz11-Oct-05 7:02 
AnswerRe: Exception while deletion -- scalar deleting destructor Pin
Tim Smith11-Oct-05 4:01
Tim Smith11-Oct-05 4:01 
GeneralRe: Exception while deletion -- scalar deleting destructor Pin
Divick11-Oct-05 21:59
Divick11-Oct-05 21:59 
Hi,
thanks for the reply. I think I am using the static CRTL(rather MSVCRT.dll, the C++ Run time library specified using the /MT flag rather than the /MD thread). But I am deleting the data within the application which is where I create it.

Further debugging into the code I have found that checking the validity of the pointer with assert and _CrtValidHeapPointer in the application does not create any problem but checking that within the DLL causes an exception. See the code snippet below;

//---------application code
MyOwnClass * myOwnPtr = new MyOwnClass();

//new and deletion is being done in the application only
_ASSERTE(_CrtIsValidHeapPointer(myOwnptr));
_ASSERTE(_CrtIsValidPointer(myOwnptr,sizeof(myOwnptr),true));
delete myOwnptr;


//-----------------DLL code

MyOwnClass()::~MyOwnClass()
{
_ASSERTE(_CrtCheckMemory());
//////////////////////////////////
//This causes a pop up box with the following message unhandled exception at 0x7c822583 in app.exe: //User breakpoint. and takes the debugger to dbgheap.c file
//////////////////////////////////
_ASSERTE(_CrtIsValidHeapPointer(this));
}

Even if I comment the code for assertion of this pointer in the above destructor then again when the destructor returns the same exception is thrown in dbgheap.c

Does it clarify my question a bit more?

Thanks for your help,
Divick
GeneralRe: Exception while deletion -- scalar deleting destructor Pin
Divick12-Oct-05 1:26
Divick12-Oct-05 1:26 
Questionlaunch googleTalk from Browser Pin
Anonymous10-Oct-05 22:40
Anonymous10-Oct-05 22:40 
Questionl Pin
Anonymous10-Oct-05 22:39
Anonymous10-Oct-05 22:39 
AnswerRe: l Pin
Prakash Nadar11-Oct-05 6:24
Prakash Nadar11-Oct-05 6:24 
QuestionHow to draw the gradient of 3 colors with rotation? Pin
CoolStarLee10-Oct-05 22:14
CoolStarLee10-Oct-05 22:14 
AnswerRe: How to draw the gradient of 3 colors with rotation? Pin
Mircea Puiu11-Oct-05 0:54
Mircea Puiu11-Oct-05 0:54 
QuestionModeless dialog communicating with parent dialog Pin
fjlv200510-Oct-05 20:44
fjlv200510-Oct-05 20:44 
AnswerRe: Modeless dialog communicating with parent dialog Pin
karmendra_js10-Oct-05 21:11
karmendra_js10-Oct-05 21:11 
AnswerRe: Modeless dialog communicating with parent dialog Pin
fjlv200510-Oct-05 23:26
fjlv200510-Oct-05 23:26 
GeneralRe: Modeless dialog communicating with parent dialog Pin
karmendra_js10-Oct-05 23:58
karmendra_js10-Oct-05 23:58 
GeneralRe: Modeless dialog communicating with parent dialog Pin
karmendra_js11-Oct-05 0:11
karmendra_js11-Oct-05 0:11 
Questionfile filtering Pin
karmendra_js10-Oct-05 20:24
karmendra_js10-Oct-05 20:24 
AnswerRe: file filtering Pin
Mircea Puiu10-Oct-05 22:51
Mircea Puiu10-Oct-05 22:51 
AnswerRe: file filtering Pin
ThatsAlok11-Oct-05 0:34
ThatsAlok11-Oct-05 0:34 
QuestionSerializing Data to file Pin
karmendra_js10-Oct-05 19:44
karmendra_js10-Oct-05 19:44 
AnswerRe: Serializing Data to file Pin
karmendra_js10-Oct-05 20:07
karmendra_js10-Oct-05 20:07 
GeneralRe: Serializing Data to file Pin
David Crow11-Oct-05 2:52
David Crow11-Oct-05 2:52 

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.