J
jraul
Hi,
This is probably a noobie question but:
I just created a new C++/CLI project in VS 2005. It created an empty
class:
public ref class Class1
{
// TODO: Add your methods for this class here.
};
I added a method and its implementation. I also added an unmanaged
instance (from a native class library I need to use) as a data member
and the compiler complained:
error C4368: cannot define 'mTest' as a member of managed
'TestProj::Class1': mixed types are not supported
Can I not have unmanaged data members in a managed class? If not, how
am I supposed to interop between managed and unmanaged code?
I took out the "public ref" prefix, and the code compiled.
This is probably a noobie question but:
I just created a new C++/CLI project in VS 2005. It created an empty
class:
public ref class Class1
{
// TODO: Add your methods for this class here.
};
I added a method and its implementation. I also added an unmanaged
instance (from a native class library I need to use) as a data member
and the compiler complained:
error C4368: cannot define 'mTest' as a member of managed
'TestProj::Class1': mixed types are not supported
Can I not have unmanaged data members in a managed class? If not, how
am I supposed to interop between managed and unmanaged code?
I took out the "public ref" prefix, and the code compiled.