远程过程调用的返回值 [英] Return value from Remote procedure call
本文介绍了远程过程调用的返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
谁能告诉我如何使用rpc将服务器的值或结果返回给客户端.
预先感谢.
Hi all
can any one tell me how i can return value or result from server back to client by using rpc.
thanks in advance.
推荐答案
对不起,我的错误
我正在将Windows XP Professional与Visual Studio 2010 Professional一起使用
我正在使用vc ++开发应用程序.
这是我使用的IDL文件
sorry my mistake
i am using windows XP professional with visual studio 2010 professional
i am using vc++ for developing application.
this is IDL file i use
// File Example1.idl
[
// A unique identifier that distinguishes this interface from other interfaces.
uuid(00000001-EAF3-4A7A-A0F2-BCE4C30DA77E),
// This is version 1.0 of this interface.
version(1.0)
]
interface Example1 // The interface is named Example1
{
// A function that takes a zero-terminated string.
void Output(
[in, string] const char* szOutput);
void Output2([out,retval] char *ptrx);
}
我无法在ptrx中获得返回值,有任何建议吗?
i can not obtain return value in ptrx , any suggestion ?
问题已解决
这是具有更改的新IDL
problem solved
here is new IDL with changes
void Output(
[in, string] unsigned char* szOutput,[out,retval,size_is(100)] unsigned char *ptrx);
void get_file(
[in,out] long *total , [in,out] long *pack , [out,retval,size_is(5000)] unsigned char* data );
这篇关于远程过程调用的返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文