Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception handling zwischen Anwendung und DLL (CLR und native mix)

5 views
Skip to first unread message

ramoc

unread,
Jan 11, 2010, 6:26:01 AM1/11/10
to
Ich verwende in meiner Applikation eine native C++ DLL, welche Exceptions
wirft um sie dann in der Hauptapplikation zu behandeln. Seitdem die
Hauptanwendung weiteren managed Code nutzt und mit /clr uebersetzt wird,
erhalte ich eine System.ExecutionEngineException sobald eine Exception in der
DLL geworfen wird.

Gibt es alternative compiler/linker settings, die Exception handling ueber
Modulgrenzen hinweg erlauben?

VIELEN DANK im voraus fuer die Unterstuetzung!
ramoc

Jochen Kalmbach [MVP]

unread,
Jan 11, 2010, 6:33:22 AM1/11/10
to
Hallo ramoc!

> Ich verwende in meiner Applikation eine native C++ DLL, welche Exceptions
> wirft um sie dann in der Hauptapplikation zu behandeln. Seitdem die
> Hauptanwendung weiteren managed Code nutzt und mit /clr uebersetzt wird,
> erhalte ich eine System.ExecutionEngineException sobald eine Exception in der
> DLL geworfen wird.
>
> Gibt es alternative compiler/linker settings, die Exception handling ueber
> Modulgrenzen hinweg erlauben?

Au weia...

Meine Empfehlung:
Kapsle alle Aufrufe zu dieser DLL in
#pragma managed(push, off)
__try
{
// Aufruf der native DLL...
} __except...

#pragma managed(pop)


Oder was verstehst Du "in der Hauptapplikation behandeln"?

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

0 new messages