G
Graham
Hi everyone,
I have a DLL which contains both native and managed C++. To
the best of my knowledge, the native code does not use MFC.
The managed C++ is basically a wrapper around the native
C++ ... so the relevant code would look like this:
public __gc class ManagedWrapper {
private:
MyNativeClass * m_pNative;
public:
ManagedWrapper() {
m_pNative = new MyNativeClass();
}
}
The native constructor isn't even getting a chance to run;
I get a stack overflow on the "new" operator. The stack
looks like this: (I'll write it out in the opposite order
to which it appears in VS.NET's call stack window, as this
is clearer in email)
VBNetApp.frmMain_Load()
ManagedWrapperDLL.ManagedWrapper()
_nh_malloc_dbg(unsigned int nSize=24, ...) Line 254 + 0x7
_lock(int locknum=4) Line 311 + 0x9
_mtinitlocknum(int locknum=4) Line 251 + 0x13
_malloc_dbg(unsigned int nSize=24, ...) Line 176 + 0x1b
Then these last four lines repeat ad infinitum until a
stack overflow occurs. The loop is clearly visible in the
code (dbgheap.c and mlock.c).
I'm using VS.NET 2003. The DLL is built in debug mode right
now (/MTd).
Can anyone tell me what I've done wrong, and/or how to
correct the problem?
Thanks.
-- graham
I have a DLL which contains both native and managed C++. To
the best of my knowledge, the native code does not use MFC.
The managed C++ is basically a wrapper around the native
C++ ... so the relevant code would look like this:
public __gc class ManagedWrapper {
private:
MyNativeClass * m_pNative;
public:
ManagedWrapper() {
m_pNative = new MyNativeClass();
}
}
The native constructor isn't even getting a chance to run;
I get a stack overflow on the "new" operator. The stack
looks like this: (I'll write it out in the opposite order
to which it appears in VS.NET's call stack window, as this
is clearer in email)
VBNetApp.frmMain_Load()
ManagedWrapperDLL.ManagedWrapper()
_nh_malloc_dbg(unsigned int nSize=24, ...) Line 254 + 0x7
_lock(int locknum=4) Line 311 + 0x9
_mtinitlocknum(int locknum=4) Line 251 + 0x13
_malloc_dbg(unsigned int nSize=24, ...) Line 176 + 0x1b
Then these last four lines repeat ad infinitum until a
stack overflow occurs. The loop is clearly visible in the
code (dbgheap.c and mlock.c).
I'm using VS.NET 2003. The DLL is built in debug mode right
now (/MTd).
Can anyone tell me what I've done wrong, and/or how to
correct the problem?
Thanks.
-- graham