G
Guest
Project built using /CLR, but code is old and has not been converted
specifically to "managed" (__gc or __value).
Everything seemed to work great, until I got the following error.
I have a class, let's call it CMyLegacyClass, that has some CString (NOT
CString*) member variables.
Problem is, when the destructor is called (which actually has an empty
body), it automatically calls the destructors for my embedded CStrings. When
this happens, I get a "System.NullReferenceException".
How can this happen since I'm not using __gc, System::String, or CString*
(or any pointers for that matter)?
I even tried adding #pragma unmanaged to the top and #pragma managed to the
bottom of the .CPP and .H files.
Please advise, as this one has me stumped.
Thanks,
Klynt
specifically to "managed" (__gc or __value).
Everything seemed to work great, until I got the following error.
I have a class, let's call it CMyLegacyClass, that has some CString (NOT
CString*) member variables.
Problem is, when the destructor is called (which actually has an empty
body), it automatically calls the destructors for my embedded CStrings. When
this happens, I get a "System.NullReferenceException".
How can this happen since I'm not using __gc, System::String, or CString*
(or any pointers for that matter)?
I even tried adding #pragma unmanaged to the top and #pragma managed to the
bottom of the .CPP and .H files.
Please advise, as this one has me stumped.
Thanks,
Klynt