Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Introduction to RPC - Part 2

, 22 Dec 2012 CPOL
An introduction to context handles in RPC. A simple RPC client/server application using context handles is explained.
// File ContextExample.idl
[
   // A unique identifier that distinguishes this interface from other interfaces.
   uuid(00000003-EAF3-4A7A-A0F2-BCE4C30DA77E),

   // This is version 1.0 of this interface.
   version(1.0)
]
interface ContextExample // The interface is named ContextExample
{
   // To fully use context handles we need to do a typedef.
   typedef [context_handle] void* CONTEXT_HANDLE;

   // Open a context on the server.
   CONTEXT_HANDLE Open(
      // Explicit server binding handle.
      [in] handle_t hBinding,
      // String to be output on the server.
      [in, string] const char* szString);

   // Output the context string on the server.
   void Output(
      // Context handle. The binding handle is implicitly
      // used through the explicit context handle.
      [in] CONTEXT_HANDLE hContext);

   // Closes a context on the server.
   void Close(
      // Context handle. The binding handle is implicitly
      // used through the explicit context handle.
      [in, out] CONTEXT_HANDLE* phContext);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anders Dalvander
Software Developer (Senior) Umetrics
Sweden Sweden
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 22 Dec 2012
Article Copyright 2003 by Anders Dalvander
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid