Wineg++ and structured exception handling

Scott Ritchie scott at open-vote.org
Wed Oct 15 14:46:16 CDT 2008


Michael Ost wrote:
> Hi,
> 
> Is there a way for wineg++ to catch windows exceptions and handle them 
> as g++ does --- cleaning up stack variables, etc?
> 
> My C++ winelib app, built with wineg++, is loading Windows DLLs. I want 
> to catch windows exceptions from functions that I call from those DLLs. 
> I need to do some cleanup if there are exceptions, and tried creating 
> some stack variables to manage that.
> 
> I found __TRY and __CATCH in wine/exception.h. Wrapping the DLL function 
> calls with __TRY and __CATCH does indeed catch exceptions, but there is 
> no stack cleanup.
> 
> There is some deep code in exception.h that implements __TRY/__CATCH 
> (which I sure could be misreading) but they look more C like than C++ 
> like... just taking care to jump to the right location without trying to 
> do any cleanup.
> 
> Window's c++ compiler evidently does that now, per this page: 
> http://msdn.microsoft.com/en-us/library/7w0chfbk(VS.80).aspx
> 
> I'm guessing I am out of luck here, but am hoping I'm just missing 
> something.
> 
> Thanks... mo
> 
> 

Wow, I remember discovering this area of winelib about 4 years ago and
wondering if anyone else was working on it or using it.  Great to hear
about you :)

Thanks,
Scott Ritchie



More information about the wine-devel mailing list