接口定义如下:
[
object,
uuid(613A0F7A-6D46-45B0-A446-787B426F0E53),
dual,
nonextensible,
helpstring("TEST Interface"),
pointer_default(ptr)
]
interface TestI: IDispatch{
[id(1), helpstring("TestMethod")] HRESULT TestMethod(
[ptr, in, size_is((int)theKeySize), length_is((int)theKeySize)]BYTE* theKey, 
[in] ULONGLONG theKeySize, 
[ptr, in, out, size_is((int)*theResultSize), length_is((int)*theResultSize)]BYTE* theResult, 
[in, out] ULONGLONG* theResultSize
);
};在客户端调用的时候如下:
BYTE sKey[1024];
ULONGLONG ullKeySize = sizeof(sKey);
::ZeroMemory(sKey, '\0', ullKeySize);
strcpy(sKey, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");BYTE sResult[1024];
ULONGLONG ullResultSize= sizeof(sResult);pTestI->TestMethod( sKey, ullKeySize, sResult, &ullResultSize );可是在服务端程序却只能收到如下内容:
sKey = 'A'
ullKeySize = 1024如果TestMethod实现函数里面对sResult 和 ullResultSize 赋值, 也只能传出sResult[0] 和 ullResultSize.请问我应该怎样定义接口才可以啊?
*因为这个函数需要用于2进制文件的处理, 所以不能用BSTR.
方便的话能用MSN联系也好, [email protected]

解决方案 »

  1.   

    可是在服务端程序却只能收到如下内容:
    sKey = 'A'
    ullKeySize = 1024-----------------------------------------------
    把代码贴出来看看撒!
      

  2.   

    [id(1), helpstring("method TestAr")] HRESULT TestAr([in, ptr, size_is(nSize)] BYTE* pbInStr, 
    [in] int nSize,
    [in, out, ptr, size_is(*nOutSize)] BYTE* pbOutBuf, 
    [in, out] int* nOutSize);把接口象上面这样定义应该就可以了。
      

  3.   

    Solution provided, Thank u very much.