When trying to use SEH in VC++, it gives an "error C2712: Cannot use __try
in functions that require object unwinding."

What's the cause of the error?

What's "object unwinding"?

Thanks!

Re: Use SEH error by Ivan

Ivan
Wed Jul 14 01:08:47 CDT 2004

You have code like

class A {
public:
A(){};
~A(){};
};

Function(){
A a;
__try {} __except(1) {};
}

Object unwinding is one of the C++ features
(implemented between the compiler and the platform)
that ensures that the objects in a given scope will be
properly constructed and destructed according
the visibility rules mandated by the language.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"pat" <pat@pattern.com> wrote in message
news:uGDTNfWaEHA.808@tk2msftngp13.phx.gbl...
> When trying to use SEH in VC++, it gives an "error C2712: Cannot use __try
> in functions that require object unwinding."
>
> What's the cause of the error?
>
> What's "object unwinding"?
>
> Thanks!
>
>



Re: Use SEH error by pat

pat
Thu Jul 15 02:24:10 CDT 2004

Ivan Brugiolo [MSFT] <ivanbrug@online.microsoft.com> wrote in message
news:OO7xHkWaEHA.3508@TK2MSFTNGP09.phx.gbl...
> You have code like
>
> class A {
> public:
> A(){};
> ~A(){};
> };
>
> Function(){
> A a;
> __try {} __except(1) {};
> }
>
> Object unwinding is one of the C++ features
> (implemented between the compiler and the platform)
> that ensures that the objects in a given scope will be
> properly constructed and destructed according
> the visibility rules mandated by the language.
>
Thanks, Ivan.

I guess what it means by "object unwinding", but how does breaking the
winding and unwinding cause such a compile error?



Re: Use SEH error by Carl

Carl
Thu Jul 15 10:50:16 CDT 2004

pat wrote:
> I guess what it means by "object unwinding", but how does breaking the
> winding and unwinding cause such a compile error?

Because the compiler doesn't support mixing C++ EH and Structured EH in a
single function.

-cd