I have a managed ( __gc ) class and a unmanaged ( __nogc ) class in the same
VC++ 2003 project (since I need to create a dotnet wrapper for some old c
library code). I can easily reference unmanaged class from the managed one,
but I'm having problems when I need to call managed class method from the
unmanaged class.
I have tried gcroot but I got into problems:
- When I just tried placing something like
gcroot<ManagedClass*> m_pManagedClass;
I got error C2065: 'ManagedClass' : undeclared identifier.
- OK, unmanaged class was missing definition of the managed one so I added
one include in the unmanaged class header file :
#include ".\ManagedClass.h"
This gave some syntax errors in the ManagedClass.h (which was compiling OK
before).
Does anybody have some ideas how can I reference the managed class from the
unmanaged? I just need to call one method.
Is there a better way of doing this.
Thanks a lot,
Sasha
Sasha Nikolic - 25 Nov 2004 14:59 GMT
From the UnmanagedClass.cpp file I can easily use System::* namespaces and
implement those objects but if I specify:
using namespace ManagedNamespace;
I get the error:
error C2871: 'ManagedNamespace' : a namespace with this name does not exist
Any help appreciated!
Cheers,
Sasha
> I have a managed ( __gc ) class and a unmanaged ( __nogc ) class in the same
> VC++ 2003 project (since I need to create a dotnet wrapper for some old c
[quoted text clipped - 21 lines]
> Thanks a lot,
> Sasha