Create a wrapper DLL with C ++ / CLI, exposing C ++ functions
eg:
class NativeClass
{
public:
int NativeMethod(int a)
{
return 1;
}
};
class ref RefClass
{
NativeClass * m_pNative;
public:
RefClass():m_pNative(NULL)
{
m_pNative = new NativeClass();
}
int WrapperForNativeMethod(int a)
{
return m_pNative->NativeMethod(a);
}
~RefClass()
{
this->!RefClass();
}
!RefClass()
{
delete m_pNative;
m_pNative = NULL;
}
};
source
share