StackOverflowException after calling unmanaged ctor

S

SteveK

**Newbie with managed C++**

I'm trying to wrap an unmanaged C++ class in a managed C++ class library.
When I instantiate the wrapper class it's ctor calls the ctor on the
unmanaged class and at that point I get the exception:
"An unhandled exception of type 'System.StackOverflowException' occurred in
suabwrapper.dll"

I have been able to reproduce this with an unmanaged class that is VERY
simple:
class CTest

{

public:

CTest(){ m_id = 1; }

~CTest(){}

int GetID(){ return m_id; };



private:

int m_id;

};





In my managed class I have a CTest* member that I assign to a new CTest() in
the managed class' ctor:

CSUABWrapper()

{

m_pTest = new CTest();

}









Once the CTest ctor is called (I can't step into the code for some reason) I
get the exception.
Anyone know what could be going on? Any ideas??

Thanks,
Steve
 
S

SteveK

Project settings are "Mixed Mode" with /noentry
linking with: mscoree.lib
also using: __DllMainCRTStartup@12
 
Joined
Jun 30, 2005
Messages
1
Reaction score
0
Hi steve

Hi Steve,

How do we turn off managed class in MSVS 2003 .Net . I have the same problem of stack overflow error.
Regards,
Georgie.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top