Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I want to create (Visual Studio 2008) a new Terminal Services ActiveX component using the existing MSRDP libraries.

I succeeded in creating a Windows Form with the Terminal Services Component for a 'normal' application.
But I want to embed it within an HTML page as an ActiveX.

I can do it with the original Mirosoft Component but I have a blank page with my component.
I tried with a simple textbox (to see if it was not an error of me) and it worked.
I use the 'drag and drop' to auto-generate the 'InitializeComponent' UserControl method.

Here it is :

C#
private void InitializeComponent()
    {
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Test));
      this.axMsTscAx1 = new AxMSTSCLib.AxMsRdpClient2();
      ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).BeginInit();

      //
      // axMsTscAx1
      //
      this.axMsTscAx1.Enabled = true;
      this.axMsTscAx1.Location = new System.Drawing.Point(58, 17);
      this.axMsTscAx1.Name = "axMsTscAx1";
      this.axMsTscAx1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMsTscAx1.OcxState")));
      this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
      this.axMsTscAx1.TabIndex = 1;
      

      this.Controls.Add(this.axMsTscAx1);
      ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).EndInit();

    }

No generation error. Dll registration ok. But I have a blank page with a red cross inside (the ActiveX is not loaded properly) when I launch the HTML (using the 'object' tag with the corresponding CLSID).

Many thanks for your help.
Posted
Updated 21-Mar-11 3:41am
v2

1 solution

I've launched the AxImp.exe utility to create the two libraries AxMSTSCLib.dll and MsTSCLib.dll with the /keyfile argument which leads to my snk project key.

I've imported the generated libraries in my project and used them to create my component.

The Terminal Service Component is well embedded in a UserControl and is well displayed in my HTML page.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900