Click here to Skip to main content
15,891,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: #if (_WIN32_IE >= 0x0500) Pin
Steve Thresher18-Aug-04 5:52
Steve Thresher18-Aug-04 5:52 
GeneralRe: NIIF_NONE Pin
Steve Thresher18-Aug-04 5:48
Steve Thresher18-Aug-04 5:48 
GeneralRe: NIIF_NONE Pin
BlackDice18-Aug-04 5:56
BlackDice18-Aug-04 5:56 
GeneralRe: NIIF_NONE Pin
BlackDice18-Aug-04 6:07
BlackDice18-Aug-04 6:07 
GeneralRe: NIIF_NONE Pin
Michael Dunn18-Aug-04 7:17
sitebuilderMichael Dunn18-Aug-04 7:17 
QuestionWhat wrong with this code? Pin
gilazilla18-Aug-04 4:51
gilazilla18-Aug-04 4:51 
GeneralDrag and Drop Using the CFSTR_FILEDESCRIPTOR / CFSTR_FILECONTENTS Formats Pin
Steve Thresher18-Aug-04 4:48
Steve Thresher18-Aug-04 4:48 
Generalnew in dll, delete in exe, bang :( Pin
Rüpel18-Aug-04 3:42
Rüpel18-Aug-04 3:42 
hi,

i'm writing a (legacy, non-MFC) dll and there might get an exception thrown in there. it is caught in the exe-file that uses that dll.

dll:
//some error<br />
throw new CSomeException();


exe:
catch (CSomeException *e)<br />
{<br />
  e->SomeFunction(); // works fine<br />
  delete e; // crash<br />
}


the delete-call crashes because the object is not a valid *local* heap-pointer.

stepping in dbgheap.c reveales the following passage
/*<br />
 * If this ASSERT fails, a bad pointer has been passed in. It may be<br />
 * totally bogus, or it may have been allocated from another heap.<br />
 * The pointer MUST come from the 'local' heap.<br />
 */<br />
_ASSERTE(_CrtIsValidHeapPointer(pUserData)); // fails


so, finally. how am i supposed to handle this? i mean throwing an exception in a library isn't that uncommon, is it? Confused | :confused:

:wq
GeneralRe: new in dll, delete in exe, bang :( Pin
Nemanja Trifunovic18-Aug-04 3:58
Nemanja Trifunovic18-Aug-04 3:58 
GeneralRe: new in dll, delete in exe, bang :( Pin
Rüpel18-Aug-04 4:22
Rüpel18-Aug-04 4:22 
GeneralRe: new in dll, delete in exe, bang :( Pin
Ravi Bhavnani18-Aug-04 4:13
professionalRavi Bhavnani18-Aug-04 4:13 
Generalbitmap file format Pin
peterworth18-Aug-04 3:21
peterworth18-Aug-04 3:21 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 4:27
professionalChris Losinger18-Aug-04 4:27 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 4:46
Anonymous18-Aug-04 4:46 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 4:54
professionalChris Losinger18-Aug-04 4:54 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 4:57
Anonymous18-Aug-04 4:57 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 5:03
professionalChris Losinger18-Aug-04 5:03 
GeneralRe: bitmap file format Pin
Anonymous18-Aug-04 5:08
Anonymous18-Aug-04 5:08 
GeneralRe: bitmap file format Pin
Chris Losinger18-Aug-04 5:14
professionalChris Losinger18-Aug-04 5:14 
GeneralRe: bitmap file format Pin
Rick York18-Aug-04 10:22
mveRick York18-Aug-04 10:22 
GeneralHELP NEEDED, With Windows Default Settings. Pin
Yaxcidia18-Aug-04 2:52
Yaxcidia18-Aug-04 2:52 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
David Crow18-Aug-04 6:19
David Crow18-Aug-04 6:19 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
Yaxcidia18-Aug-04 8:19
Yaxcidia18-Aug-04 8:19 
GeneralRe: HELP NEEDED, With Windows Default Settings. Pin
David Crow18-Aug-04 8:38
David Crow18-Aug-04 8:38 
QuestionDialogs Skins ??? Pin
zahid_ash18-Aug-04 2:04
zahid_ash18-Aug-04 2:04 

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.