.NET
  Home arrow .NET arrow Page 2 - Introduction to RPC on Windows: Part I
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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 I
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 20
    2005-01-10

    Table of Contents:
  • Introduction to RPC on Windows: Part I
  • Meet IDL
  • Doing the RPC stuff
  • Writing Server Side code
  • Writing Client Side Code
  • Points of Interest

  • 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 I - Meet IDL


    (Page 2 of 6 )

    If we’re to write applications using RPC on Windows, we must surely be aware of a language that can describe the interface that the server will expose to the client -- basically a channel that sets an agreement between the client and the server. IDL is just that such a thing!

    IDL stands for Interface Definition Language. It's a language for defining interfaces to which the client and server should adhere. You might be thinking, "what the heck? A new language just to define interfaces?! Can’t I just make a pure abstract class in C++ and use it?" I too wish that to be true but the fact of life is that the syntax of C or C++ doesn’t allow one to clearly mark a method quite precisely –- I mean in a way that both client and server running across process boundaries, or maybe machine boundaries, may communicate. Fortunately the syntax of IDL is very intuitive and similar to C/C++, and therefore is easy to grasp. So writing an IDL file is somewhat similar to writing a C header file with some added keywords and constructs. IDL is basically an attributed programming language and thus can describe parameters, functions and interfaces in a more precise and descriptive way than C.

    Do you “C” the application?

    Let’s start with an example so that we grasp the most essential concepts as we encounter them in the process. First we shall take up a simple program and then add to it the Client/Server functionality using RPC. This will let you see clearly the role RPC plays.

    // File NoRPC.cpp
    using namespace std;
    #include <iostream>

    // our would be server function.
    void Foo(const char* szMsg)
    {
    std::cout << szMsg << std::endl;
    }

    int main()
    {
    // There is no server
    // Call local
    Foo("I can’t RPC Foo!");
    }

    This small code fragment does nothing but print ‘I can’t RPC Foo!’ to the console window.

    More .NET Articles
    More By Digvijay Chauhan


       · Hi,I was able to compile the *.idl file. But I am getting an error while trying to...
       · i successfully compile the code...but when i running server program i got pop up...
       · First of all I would like to thank you for such wonderful articles on smart card and...
       · You may use the Smart Client like approach to execute Smart Card commands via the...
       · Its very kind of you to respond to my query. We were going through a office move and...
       · It's simple,a C# or J# script would do the job ...... only required thing is...
       · Hi DigvijayThanks very much for the response, but I am still struggling how to...
       · Hi,I believe i conveyed something wrong.What i meant was ........ after...
       · I am so sorry, this is my first ever attempt on .net and I am still not quite sure ...
       · First ..... You need not register the script if you have it running on the client...
       · I think I now understand whats happening.This is my latest codeprivate void...
       · Dear Friend,You've done it finally.Just enable Smart Clients on the client...
       · Hithanks for good article.I have some problem with MIDLhow I can get...
       · I am not able to compile the server code its stating that the function does not...
       · I am not able to compile the server code its stating that the function does not...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT