Re: unexpected exception handler

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Sorry for my limited knowledge, Igor!


1. Do you mean COM/ATL API does not and should not throw any exception?

2. I keep my solution into separate DLLs and a single EXE which utilizes the
DLL for the reason of packaging and better upgrade, make them into different
components.

3.

I think you mean DLL can not throw exception because there is no
binary standard in C++ means something designed in different
language/compiler. Right?:-)

I can't parse this statement. Doesn't look like well-formed English to
me, sorry.

Sorry for my bad description. What I mean is, you mentioned before that if
DLL and EXE are using different compiler, it is not safe to let the exported
API in DLL throw an exception and let the EXE catch it. The reason is there
in no binary standard in C++, so no binary standard to describe an exception
between the DLL and the EXE. Are my understanding of your points correct?


have a good weekend,
George

"Igor Tandetnik" wrote:

"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:91977348-5041-4493-A88E-2837583E43A0@xxxxxxxxxxxxx
1. The exceptions from other DLLs, samples are exceptions from ATL,
COM, etc. Is it correct sample?

What makes you believe ATL uses C++ exceptions? Can you cite any
evidence of this?

What makes you believe COM uses C++ exceptions? Can you cite any
evidence of this?

Are you just shooting up any odd three-letter acronyms you can think of,
in hopes one of them sticks? I can't help but wonder what this line of
enquiry is supposed to achieve.

2. If I myself both write the DLL and the DLL consumer (application)
in the same compiler (Visual C++ and only in this language), could I
throw exception in the DLL exported API to application?

Yes, if you commit to always build both the EXE and the DLL with the
same version of the same compiler, and link both against the same flavor
of CRT DLL. But if you do all this, it's not clear why you would want to
package the code into two separate modules. Why not just compile all
code into a single EXE? The whole point of DLLs is binary reuse, but by
using C++ exceptions in the DLL's interface you preclude precisely that.

I think you mean DLL can not throw exception because there is no
binary standard in C++ means something designed in different
language/compiler. Right?:-)

I can't parse this statement. Doesn't look like well-formed English to
me, sorry.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



.



Relevant Pages

  • Re: (Re)throwing from a catch block across dll boundaries
    ... Thank you for the sample project, I'm able to reproduce the issue you're describing. ... within VS) and found the same results: when I linked both the Dll and the ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)
  • Global Assembly Cache Issue
    ... I have a dll that I use in several projects, that I placed in the Global ... you can see in the Exception below). ... If I change the Copy Local property of the reference to True, ... Attempting download of new URL ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... If you encounter the problems described in this thread, check your compiler settings and change Code Generation/Runtime Library to 'Multi- threaded Debug DLL ' and 'Multi- threaded DLL '. ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... when I used the command line parameters you have provided for the dll I ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ... Throw an object of the class from the exported function, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... This unexpected behavior is caused by a limitation of the runtime included in VisualStudio. ... In order to have C++ exceptions work reliably across modules you'd have to use only one copy of the CRT (so linking _all_ the modules with the DLL version of the CRT as you have noticed). ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)