.NET
  Home arrow .NET arrow Page 3 - Introduction to RPC on Windows, Part II
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Introduction to RPC on Windows, Part II
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2005-01-17

    Table of Contents:
  • Introduction to RPC on Windows, Part II
  • Types of Handles
  • Types of Binding Handles
  • Implicit binding handles
  • Explicit binding handles

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to RPC on Windows, Part II - Types of Binding Handles


    (Page 3 of 5 )

    Before we use any binding handles let’s take a look at their various types and when to use each one. Binding handles are of three types:

    • Automatic 
    • Implicit
    • Explicit

    You must decide which one of these to use based on the amount of control you need to have over the binding process or the process of creating a logical connection.

    Automatic binding handles

    Automatic binding handles really automate the binding process and you don’t have any control over this process whatsoever. The good news is that the client and server applications do not need to publish any code to handle the binding process. One may use these handles when the application does not require a specific server and when it does not need to maintain any state information between the client and server. To use Automatic binding in your applications you need to specify that you will use automatic binding handles in the application Configuration File (ACF). The code for the generated stub by the MIDL Compiler then contains the code for managing automatic binding. A typical ACF file for automatic handles looks like the one below:

    /* ACF file */
    [
      auto_handle
    ]
    interface MyInterface
    {
     // Any Methods
    }

    So what happens when the ACF does not include any other handle attribute, and when the remote procedures do not use explicit handles; how would binding would occur? It’s simple -- the MIDL compiler uses automatic handles by default. The same things happen when the ACF file is not present. One more thing to be aware of is that you must not provide an auto handle as an argument to any of the remote procedures declared in your interface. A Sample IDL would look like the one below:

    /* IDL file */
    [
      uuid (6B29FC33-CA47-1067-B31D-00DD010662DA),
      version(1.0),
      pointer_default(unique)
    ]

    interface IFoo
    {
      void GetRange([out] long * min);
      void Shutdown([in] long * nAfterStep);
    }

    More .NET Articles
    More By Digvijay Chauhan


       · Hi I'm Digvijay ....... the author of this article.Please feel free to ask any...
       · I do like your explaination on the topic of RPC. I try to used them to solve...
       · Thank you for your article. I am having a problem where the sever denies access to...
       · Hi,I didn't get what you're trying to solve. Could you please give me the...
       · What is the exact error do you get?Would you like me to take a look at the...
     

    .NET ARTICLES

    - Introducing .NET
    - Building Business Objects for an Application
    - Methods for an Application`s Business Logic ...
    - Properties of an Application`s Business Logi...
    - Classes and Properties in an Application`s B...
    - Organizing Code for the Business Logic Layer...
    - Building the Business Logic Layer
    - Completing a Business Layer with Windows Wor...
    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek