这里的大大,有谁对类似这样的 RPC  API 比较熟悉的
NdrConformantArrayMarshall
NdrProxySendReceive
NdrXXXXXXXXXX....
.......
.......我想了解,在什么样的情况下,会用到这样的 RPC  API ,
最好有个简单的例子模板,不知道大大们对这些有没有研究了实在是没办法了。。
活生生找了两天的资料,没看到一篇是讲这些的,都快疯了。

解决方案 »

  1.   

    你是说MSDN里说的你看不明白?
      

  2.   

    msdn的rpc主題 帶了sample的  
    Platform SDK: Remote Procedure Call 
    Examples
    The Platform SDK includes examples that demonstrate a variety of Remote Procedure Call (RPC) concepts, as follows: ASYNCRPC illustrates the structure of an RPC application that uses asynchronous remote procedure calls. It also demonstrates various methods of notification of the call's completion. 
    CALLBACK demonstrates use of the [callback] attribute. 
    CLUUID demonstrates use of the client-object UUID to enable a client to select from multiple implementations of a remote procedure. 
    DATA directory contains four programs: DUNION illustrates discriminated (nonencapsulated) unions; INOUT demonstrates [in, out] parameters; REPAS demonstrates the [represent_as] attribute; XMIT demonstrates the [transmit_as] attribute. 
    DICT is a remote splay tree-based dictionary program that uses the [implicit_handle], [context_handle], [in] attribute, and [out] attribute. 
    DOCTOR is an RPC psychotherapy application that demonstrates arrays, strings, and the [size_is] attribute. 
    DYNEPT demonstrates a client application managing its connection to the server through dynamic endpoints. 
    DYNOUT demonstrates how to allocate memory at a server for an n-byte object and pass it back to the client as an [out]-only parameter. The client then frees the memory. This technique allows the stub to call the server without knowing in advance how much data will be returned. 
    HANDLES directory contains three programs, AUTO, CXHNDL, USRDEF, which demonstrate [auto_handle], [context_handle], and generic (user-defined) handles, respectively. 
    HELLO is a client/server implementation of "Hello, world." 
    INTEROP demonstrates portability between Open Software Foundation–Distributed Computing Environment (OSF-DCE) and Microsoft® RPC. 
    MANDEL is a distributed fractal drawing program. It uses [ref] pointers, the [implicit_handle] attribute, and handle_t primitive types. 
    NS directory contains the NHELLO program, which demonstrates name service usage. The CDS directory contains the files that describe the gateway protocol to the DCE Cell Directory Service (CDS). 
    OBJECT directory contains two programs that demonstrate OLE custom interfaces. CALLAS uses the [call_as] attribute to transmit a nonremotable interface. OHELLO demonstrates correct reference counting and shutdown behavior for a multiple-use local server. OHELLO also demonstrates how to use the Windows registry functions to install a local server and a proxy DLL in the registry. 
    PICKLE directory contains two programs: PICKLP demonstrates data procedure serialization; PICKLT demonstrates data type serialization; both programs use the [encode] and [decode] attributes. 
    PIPES demonstrates the use of the pipe type constructor. 
    RPCSSM demonstrates the RPCSS memory management model. 
    RPCSVC demonstrates the implementation of a Windows NT®/Windows® 2000™ service with RPC. 
    STROUT demonstrates how to allocate memory at a server for a two-dimensional object (an array of pointers) and pass it back to the client as an [out]-only parameter. The client then frees the memory. This technique allows the stub to call the server without knowing in advance how much data will be returned. 
    This program also allows the user to compile either for UNICODE or ANSI. You can browse through most of these files in Reference/Code Samples/NETDS/RPC in the Platform SDK. All of the source files and makefiles for these programs are located in the SDK at mstools\samples\rpc.
    Platform SDK Release: August 2001  What did you think of this topic?
    Let us know.  Order a Platform SDK CD Online
    (U.S/Canada)   (International)  
      

  3.   

    http://msdn.microsoft.com/en-us/network/bb896012.aspx
      

  4.   

    先谢谢楼上的大大们,恩, MSDN 上是有,但是只是介绍了这些函数的原型和参数而已。我是想找个能系统的讲解一下这些用这些 API 进行 RPC 通讯的例子。打个比方:我现在想要的是一个类似介绍 最简单的 SOCKET 通讯模型的代码模板, 就是类似的,用这些 RPC API 进行通讯的模型,大大们能理解否???
    又啃了一天COM+ 明白了 代理和存根文件是通过 IDL 来生成的,也就是西裤哥说的,不需要自己显示调用,COM 会生成相关代码,
    但是我想知道,什么时候,什么情况下 会生成 包含有 NdrProxySendReceive 之类的 API 的代码?因为我自己做了个例子,看他生成的代码里面没有 我关心的 NDR 之类的相关函数。
      

  5.   

    COM自動生成的代理存根調用你不需要理會 它的這些代碼據説根本是不可讀的 因爲命名什麽的都沒有考慮給人來看
    你也沒有必要看COM/COM+ 它只是用Windows提供的RPC API來實現遠程通信的功能
    RPC API比起COM來 優勢就是他的性能更好(因爲他是較低級的接口)
    你要的是一個利用RPC API的Hello,world例子嗎?那我給的連接的samples一項中就提到了 我是msdn 2001 oct版本
    在msdn安裝目錄的\samples\vc98\sdk\netds\rpc\hello 下