title: Screen sharing Application in C# for Windows Xp with using RDP Viewer Class Component
body: <p>I am trying to develop Basic Screen Sharing Application for in C# language for windows Xp.</p>
  
  <p>I have develop Basic Application with using <strong>RDPCOMAPILib</strong>  means <strong>rdpcomapi 1.0 type library</strong></p>
  
  <p>and <strong>RDPViewer Class Component</strong>. its works fine on windows 7 but its not work on windows XP because its not find <strong>RDPViewer Class Component</strong> I have created two module for this first for host and Second is Viewer In host its generate unique code which use for connect to remote computer. My code is below</p>
  
  <blockquote>
    <p>using System.Runtime.InteropServices;</p>
    
    <p>using RDPCOMAPILib;</p>
  </blockquote>
  
  <pre><code>    RDPSession x = new RDPSession();
      public Form1()
      {
          InitializeComponent();
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
  
      }
  
      private void Incoming(object Guest)
      {
          IRDPSRAPIAttendee MyGuest = (IRDPSRAPIAttendee)Guest;//???
          MyGuest.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_INTERACTIVE;
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          x.OnAttendeeConnected += Incoming;
          x.Open();
  
      }
  
      private void button2_Click(object sender, EventArgs e)
      {
          IRDPSRAPIInvitation Invitation = x.Invitations.CreateInvitation("Trial", "MyGroup", "", 10);
          textBox1.Text = Invitation.ConnectionString;
  
      }
  
      private void button3_Click(object sender, EventArgs e)
      {
          x.Close();
          x = null;
  
      }
  </code></pre>
  
  <p>And Viewer Code is </p>
  
  <pre><code>    public Form1()
      {
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          string Invitation = textBox1.Text;// "";// Interaction.InputBox("Insert Invitation ConnectionString", "Attention");
          axRDPViewer1.Connect(Invitation, "User1", "");
  
      }
  
      private void button2_Click(object sender, EventArgs e)
      {
          axRDPViewer1.Disconnect();
  
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          panel1.Height = Screen.PrimaryScreen.Bounds.Height - 100;
      }
  }
  </code></pre>