G
George Economos
Is the following code correct (managed c++ console app):
// native classes
#pragma unmanaged
class MyException {};
class MyThrow
{
MyThrow()
{
throw MyException();
}
};
// managed main
#pragma managed
void main()
{
try
{
MyThrow m;
}
catch( MyException & e )
{
Console::WriteLine( "Null reference." );
}
}
Using vs.net 2003 on xp sp2 I get a null reference to the exception in
the catch handler. However, If I catch the exception by value
everything works ok. Is the marshalling between native and managed
screwing this up?
Thanks,
George Economos
// native classes
#pragma unmanaged
class MyException {};
class MyThrow
{
MyThrow()
{
throw MyException();
}
};
// managed main
#pragma managed
void main()
{
try
{
MyThrow m;
}
catch( MyException & e )
{
Console::WriteLine( "Null reference." );
}
}
Using vs.net 2003 on xp sp2 I get a null reference to the exception in
the catch handler. However, If I catch the exception by value
everything works ok. Is the marshalling between native and managed
screwing this up?
Thanks,
George Economos