描述:
我现在要开发一个com元件其主要的功能如下
1 发送packet
2 接收packet
现在第一个我已经ok了 我的定义如下:
[id(4), helpstring("method SendPacket")] HRESULT SendPacket([in]BSTR Receiver ,[in]SAFEARRAY(BYTE) buffer);
其中的 buffer部分我用了safearray的类型.我在C#上Call它是完全ok的
问题出在接收上我的定义如下
[id(1), helpstring("method OnReceive")] HRESULT OnReceive([in]BSTR sender ,[int]SAFEARRAY(BYTE) buffer,[in] int nLen );
现在就是我在C#作了这个EventHandler 那现在有packet过来的时候并没有fire 这个event 我很糊涂是不是我定义上的错误.
在compile这个元件的时候 vc 下会有warning 信息如下
warning C4800: 'struct tagSAFEARRAY ** ' : forcing value to bool 'true' or 'false' (performance warning)
e:\souce code\chainsea\gwsr\gwsrcp.h(44) : while compiling class-template member function 'long __thiscall CProxy_IVGWSREvents<class CVGWSR>::Fire_OnReceive(unsigned short *,struct tagSAFEARRAY ** ,int)'
希望开发com有经验的人能给帮我解决这个bug
谢谢.<在线等待中......>