Click here to Skip to main content
15,921,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct13-Apr-06 22:39
toxcct13-Apr-06 22:39 
AnswerRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:17
Cedric Moonen14-Apr-06 4:17 
Probably what's happening (not sure at all) is that the string is allocating dynamically memory for its internal purpose. Then, when firing the exception, it will be catched in your exe and upon calling the destructor of this string, it will try to delete this memory. Unfortunately, as it hasn't been allocated by the same module (by the dll and not by your exe) this will crash.

But this is difficult to understand because you don't know how it works internally. A thing is sure: when you allocate memory in a dll and try to delete it inside your exe, this will crash the program. That's why classes exported from a dll have a Destroy method (it is just a delete this).

But here, I don't know how it works when an exception is fired...
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct14-Apr-06 4:25
toxcct14-Apr-06 4:25 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:35
Cedric Moonen14-Apr-06 4:35 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct14-Apr-06 4:35
toxcct14-Apr-06 4:35 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:38
Cedric Moonen14-Apr-06 4:38 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct14-Apr-06 4:46
toxcct14-Apr-06 4:46 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:52
Cedric Moonen14-Apr-06 4:52 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct15-Apr-06 1:14
toxcct15-Apr-06 1:14 
Generalat last, solvedn thanks to you ! Pin
toxcct15-Apr-06 8:33
toxcct15-Apr-06 8:33 
GeneralRe: at last, solvedn thanks to you ! Pin
Cedric Moonen16-Apr-06 1:45
Cedric Moonen16-Apr-06 1:45 
AnswerRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:43
Cedric Moonen14-Apr-06 4:43 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
toxcct14-Apr-06 4:45
toxcct14-Apr-06 4:45 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:49
Cedric Moonen14-Apr-06 4:49 
GeneralRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Cedric Moonen14-Apr-06 4:54
Cedric Moonen14-Apr-06 4:54 
AnswerRe: Cannot throw my own exception from dll (not exactly true, but please read) Pin
Stephen Hewitt14-Apr-06 21:28
Stephen Hewitt14-Apr-06 21:28 
QuestionWhy VC++? Pin
HakunaMatada13-Apr-06 22:36
HakunaMatada13-Apr-06 22:36 
AnswerRe: Why VC++? Pin
toxcct13-Apr-06 22:42
toxcct13-Apr-06 22:42 
GeneralRe: Why VC++? Pin
HakunaMatada13-Apr-06 23:10
HakunaMatada13-Apr-06 23:10 
AnswerRe: Why VC++? Pin
David Crow14-Apr-06 2:50
David Crow14-Apr-06 2:50 
Questioninclude files Pin
uriblum13-Apr-06 22:35
uriblum13-Apr-06 22:35 
AnswerRe: include files Pin
toxcct13-Apr-06 22:42
toxcct13-Apr-06 22:42 
QuestionAbout a Ebook "Inside OLE" Pin
tombfifa13-Apr-06 22:20
tombfifa13-Apr-06 22:20 
QuestionWorking with WM_DESTROY Pin
Axonn Echysttas13-Apr-06 22:08
Axonn Echysttas13-Apr-06 22:08 
AnswerRe: Working with WM_DESTROY Pin
Michael Dunn13-Apr-06 22:14
sitebuilderMichael Dunn13-Apr-06 22:14 

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.