我正在尝试使用c-sharp与基于Windows的api集成,我遇到了这个问题。
api向我发送一个指向结构的指针,该结构包含一堆虚拟方法
struct CApiInterface
{
virtual int __stdcall Version(void);
...
}
我的问题是,如何在C#中调用此方法?我想做点什么:
CApiInterface _api;
public void Start(CApiInterface* api)
{
_api = api;
}
...
public void SomeOtherMethod()
{
_api.version();
}
如果可能的话,我想尽可能不使用CLI / C ++。