From: Adam on
Hello,

I hope I'm not being too much rude and I could consult you in a problem I have.

I'm trying to achieve exactly what that guy in the following article did.

http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx

After I have downloaded that guy's code project I see he reference a AxMSTSCLib dll (which you have to create manually for your pc).


I have tried to create my own AxMSTSCLib dll following this link:
http://bytes.com/topic/c-sharp/answers/684780-axmstsclib-axmstscax-known-issue

The problem is that the dll differs from wahat actually needed (see my thread below)

As seen in the attached print-screen my dll doesn't contain an AxHost that is used to execute the command:


IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();

Any idea how to solve this?



photos attached:

http://drop.io/hidden/eopb4tphk8qekl/asset/bm8tZ2V0LW9jeC1qcGc%253D

http://drop.io/hidden/eopb4tphk8qekl/asset/Z2V0b2N4LTEtanBn


Do you know someone that could assist me?
Regards,
Elad




Tony wrote:

AxMSTSCLib.AxMsTscAx - known issue
28-Jul-07

Embedding in a .net WinApp:


An unhandled exception of type 'InvalidActiveXStateException' occurred in
axmstsclib.dll

Happens on line:

axMsTscAx1.Server = "192.168.1.44"





directions followed:


1. md c:\temp
2. cd c:\temp
3. %<SDK bin directory>%\aximp.exe %windir%\system32\mstscax.dll
This will generate MSTSCLib.dll and AxMSTSCLib.dll.
Make sure Interop.MSTSCLib.dll and AxInterop.MSTSCLib.dll have been deleted
in the obj and bin\Debug directories.
4. Copy the generated files (without renaming) - MSTSCLib.dll and
AxMSTSCLib.dll into the project's obj directory.
5. In the project's references, add MSTSCLib.dll and AxMSTSCLib.dll from
the obj directories.
6. Now, instead of drag-drop'ing the control from the toolbox, write code
to add the control:
Goto Form.cs code view
Declare: private AxMSTSCLib.AxMsTscAx axMsTscAx1;
In InitializeComponent:
this.axMsTscAx1 = new AxMSTSCLib.AxMsTscAx();
((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.OcxStat
e")));
this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
this.axMsTscAx1.TabIndex = 1;
.....

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

Previous Posts In This Thread:

On Saturday, July 28, 2007 7:50 PM
Tony wrote:

AxMSTSCLib.AxMsTscAx - known issue
Embedding in a .net WinApp:


An unhandled exception of type 'InvalidActiveXStateException' occurred in
axmstsclib.dll

Happens on line:

axMsTscAx1.Server = "192.168.1.44"





directions followed:


1. md c:\temp
2. cd c:\temp
3. %<SDK bin directory>%\aximp.exe %windir%\system32\mstscax.dll
This will generate MSTSCLib.dll and AxMSTSCLib.dll.
Make sure Interop.MSTSCLib.dll and AxInterop.MSTSCLib.dll have been deleted
in the obj and bin\Debug directories.
4. Copy the generated files (without renaming) - MSTSCLib.dll and
AxMSTSCLib.dll into the project's obj directory.
5. In the project's references, add MSTSCLib.dll and AxMSTSCLib.dll from
the obj directories.
6. Now, instead of drag-drop'ing the control from the toolbox, write code
to add the control:
Goto Form.cs code view
Declare: private AxMSTSCLib.AxMsTscAx axMsTscAx1;
In InitializeComponent:
this.axMsTscAx1 = new AxMSTSCLib.AxMsTscAx();
((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.OcxStat
e")));
this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
this.axMsTscAx1.TabIndex = 1;
.....

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


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 2
http://www.eggheadcafe.com/tutorials/aspnet/0ad2fa61-7f0c-485f-92c9-cf3a9ee210a7/wpf-report-engine-part-2.aspx
From: GS on
would the
microsoft.public.dotnet.framework.interop
be a better newsgroup for this?

General articles in Code projects works very well when the directions are
read and followed. Granted, at times, one might have to re-read some part to
get the "drift"

<Adam Gady> wrote in message news:201041694218adamgady(a)gmail.com...
> Hello,
>
> I hope I'm not being too much rude and I could consult you in a problem I
have.
>
> I'm trying to achieve exactly what that guy in the following article did.
>
> http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx
>
> After I have downloaded that guy's code project I see he reference a
AxMSTSCLib dll (which you have to create manually for your pc).
>
>
> I have tried to create my own AxMSTSCLib dll following this link:
>
http://bytes.com/topic/c-sharp/answers/684780-axmstsclib-axmstscax-known-issue
>
> The problem is that the dll differs from wahat actually needed (see my
thread below)
>
> As seen in the attached print-screen my dll doesn't contain an AxHost that
is used to execute the command:
>
>
> IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
>
> Any idea how to solve this?
>
>
>
> photos attached:
>
> http://drop.io/hidden/eopb4tphk8qekl/asset/bm8tZ2V0LW9jeC1qcGc%253D
>
> http://drop.io/hidden/eopb4tphk8qekl/asset/Z2V0b2N4LTEtanBn
>
>
> Do you know someone that could assist me?
> Regards,
> Elad
>
>
>
>
> Tony wrote:
>
> AxMSTSCLib.AxMsTscAx - known issue
> 28-Jul-07
>
> Embedding in a .net WinApp:
>
>
> An unhandled exception of type 'InvalidActiveXStateException' occurred in
> axmstsclib.dll
>
> Happens on line:
>
> axMsTscAx1.Server = "192.168.1.44"
>
>
>
>
>
> directions followed:
>
>
> 1. md c:\temp
> 2. cd c:\temp
> 3. %<SDK bin directory>%\aximp.exe %windir%\system32\mstscax.dll
> This will generate MSTSCLib.dll and AxMSTSCLib.dll.
> Make sure Interop.MSTSCLib.dll and AxInterop.MSTSCLib.dll have been
deleted
> in the obj and bin\Debug directories.
> 4. Copy the generated files (without renaming) - MSTSCLib.dll and
> AxMSTSCLib.dll into the project's obj directory.
> 5. In the project's references, add MSTSCLib.dll and AxMSTSCLib.dll from
> the obj directories.
> 6. Now, instead of drag-drop'ing the control from the toolbox, write code
> to add the control:
> Goto Form.cs code view
> Declare: private AxMSTSCLib.AxMsTscAx axMsTscAx1;
> In InitializeComponent:
> this.axMsTscAx1 = new AxMSTSCLib.AxMsTscAx();
> ((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.OcxStat
> e")));
> this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
> this.axMsTscAx1.TabIndex = 1;
> ....
>
> this.Controls.Add(this.axMsTscAx1);
> ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).EndInit();
>
> Previous Posts In This Thread:
>
> On Saturday, July 28, 2007 7:50 PM
> Tony wrote:
>
> AxMSTSCLib.AxMsTscAx - known issue
> Embedding in a .net WinApp:
>
>
> An unhandled exception of type 'InvalidActiveXStateException' occurred in
> axmstsclib.dll
>
> Happens on line:
>
> axMsTscAx1.Server = "192.168.1.44"
>
>
>
>
>
> directions followed:
>
>
> 1. md c:\temp
> 2. cd c:\temp
> 3. %<SDK bin directory>%\aximp.exe %windir%\system32\mstscax.dll
> This will generate MSTSCLib.dll and AxMSTSCLib.dll.
> Make sure Interop.MSTSCLib.dll and AxInterop.MSTSCLib.dll have been
deleted
> in the obj and bin\Debug directories.
> 4. Copy the generated files (without renaming) - MSTSCLib.dll and
> AxMSTSCLib.dll into the project's obj directory.
> 5. In the project's references, add MSTSCLib.dll and AxMSTSCLib.dll from
> the obj directories.
> 6. Now, instead of drag-drop'ing the control from the toolbox, write code
> to add the control:
> Goto Form.cs code view
> Declare: private AxMSTSCLib.AxMsTscAx axMsTscAx1;
> In InitializeComponent:
> this.axMsTscAx1 = new AxMSTSCLib.AxMsTscAx();
> ((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.OcxStat
> e")));
> this.axMsTscAx1.Size = new System.Drawing.Size(192, 192);
> this.axMsTscAx1.TabIndex = 1;
> ....
>
> this.Controls.Add(this.axMsTscAx1);
> ((System.ComponentModel.ISupportInitialize)(this.axMsTscAx1)).EndInit();
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> WPF Report Engine, Part 2
>
http://www.eggheadcafe.com/tutorials/aspnet/0ad2fa61-7f0c-485f-92c9-cf3a9ee210a7/wpf-report-engine-part-2.aspx