我正在创建一个依赖于众多C++静态库的C++/CLI包装器DLL。一些函数调用需要传入非托管指针。我如何正确传递它们?在C++/CLI中传递非托管指针
此外,其他函数期望“this pointer”作为void *传入。什么是通过“这个”的正确途径?
这里是我的类定义...
public ref class RTPClient
{
public:
RTPClient();
~RTPClient();
bool Connect();
void Disconnect();
private:
CIsmaClient* mClient;
};
这里是我的使用,其中有问题的指针被用来...
RTPClient::RTPClient():
mClient(NULL)
{
CIsmaClient::Create(&mClient, NULL, &AllocBuffer, &GetDataPointer, this);
}
&和移动客户端的使用“此“导致以下编译器错误... 1>。\ VBLoadSimulatorDll.cpp(40):错误C2664:'CIs maClient ::创建”:不能从转换参数1 'CLI :: interior_ptr' 到 'CIsmaClient **' 1>使用 1> [ 1>类型= CIsmaClient * 1>]
1> \。 VBLoadSimulatorDll.cpp(40):错误C2664:'CIsmaClient :: Create':无法将参数5从'VBLoadSimulator :: RTPClient^const'转换为'VOID *'
这里是正确的链接: http://msdn.microsoft.com/en-us/library/1dz8byfh.aspx – 2009-02-20 14:39:03
的指针是,虽然非受管类... – cjserio 2009-02-20 14:44:49