I have a native class in C++ and a managed class in C++/CLI. The C++/CLI is a wrapper for the C++. Both classes have the same name, but exist in different namespaces. For some reason I haven't yet grasped, I am receiving compiler errors regarding trying to declare pointers to the managed class, but my code is in fact trying to declare pointers to the native class using fully qualified names. What gives?
"Native\Header.h"
namespace Native
{
class MyClass {};
}
"Managed/Header.h"
namespace Native { class MyClass; }
// Or
class Native::MyClass;
namespace Managed
{
ref class MyClass
{
Native::MyClass* m_Native; // Error C3699
};
}
error C3699: '*' : cannot use this indirection on type 'Managed::MyClass'