我想将C++ API转换为VB.Net,但是这个函数太难了,我不知道如何使它工作。将回调函数从C++转换为VB.Net
下面是此功能的API文档:
void RemoteDllSetReceiver(void *inst, on_received_buffer_t received_buf_cb);
设置一个回调函数从DLL接收通知。回调的原型为:
typedef bool (*on_received_buffer_t)(void* inst, const unsigned char *buffer, unsigned int size);
凡
- 研究所是最初传递给RemoteDllSetReceiver
- 缓冲&大小包含为远程协议中规定的通知文本的指针。
注意:通知可能会到达不同的线程(例如网络,计时器,音频)。
我无法想象我在做什么on_received_buffer_t,它必须是一个委托?就像你可以阅读,这个函数返回DLL的通知,如连接状态,用户ID ...
任何帮助将不胜感激,谢谢。
'on_received_buffer_t'是指向与原型的回调函数,你已经证明。我不熟悉VB.NET,但是是的,可能它必须是'委托',可能'(我刚刚从[这里]复制并粘贴(http://www.pcreview。 co.uk/forums/thread-2339674.php))。它可能有助于提及它是什么API,并可能举例说明不起作用的代码? –
2010-10-20 09:48:23