interface ISenderConfig ;[
    object,
uuid (C080ED0F-69A3-47a4-BAD0-A2B34BE68ACE)
]
interface ISenderConfig  : IUnknown
{
    HRESULT
    SetSenderFun (
        [in]   void* NetSenderFun) ;//这里,这个参数类型怎么写呢?
HRESULT
GetVideoMediaType(
[out] UCHAR* pFormat,
[out] ULONG* iLength
);
} ;
我写成void* ,编译时有错:
error MIDL2139 : type of the parameter cannot derive from void or void * : [ Parameter 'NetSenderFun' of Procedure 'SetSenderFun' ( Interface 'ISenderConfig' ) ]请教,要想实现通过COM接口设置一个回调函数,如何定义idl?

解决方案 »

  1.   

    应该按connectable objects规范去做.=======================================================
    FreeLaxy, your backup.
    =======================================================
      

  2.   

    去看下杨老师的教程吧,讲连接点的。
    http://www.vckbase.com/document/viewdoc/?id=1539
      

  3.   

    不要使用 回调
    使用 sink event
      

  4.   

    在COM技术里面应该使用回调接口,也就是连接点。
      

  5.   

    MIDL is a strongly typed language. All parameters transmitted over the network must be derived from one of the MIDL base types. MIDL does not support void as a base type. You must change the declaration to a valid MIDL type. 
    msdn上的这段话说定义IDL时参数类型不能是void或void *。