mixed DLL w/ managed Class

J

Juli

Hello NG,

my DLL contains both managed and unmanaged code. I have problems with
a pointer declaration in a managed class

public __gc class MClass {
private:
WrappedClass __nogc * m_pM; //Syntax-Error!!!!
MClass() { m_pM = new WrappedClass(); }
~MClass() { delete m_pM; }
}
The WrappedClass is known to the Compiler since it is defined in the
same project and I also put an #include at the beginning of the file.
Now I get this error:
ManagedClass.cpp(18): error C2144: Syntax-Error: 'int' should
follow';'
(I tried to translate it, cause I have the German version)
Can anybody help me?

Thanks in advance,
Juli
 
J

Jon

The following complies fine for me, does it compile for you?

class WrappedClass {
};

public __gc class MClass {
private:
WrappedClass __nogc * m_pM;
MClass() { m_pM = new WrappedClass(); }
~MClass() { delete m_pM; }
};
 

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