how to use mstsclib

左手的ㄟ右手 2022-01-12 13:35 390阅读 0赞

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you have drag and drop a Terminal
Services Control on a windows form, a compiler error was generated. If
there is any misunderstanding, please feel free to let me know.

Based on my research, this is a known issue. The wrapper generater fails to
generate correct method for returning an enum value. Here is a workaround.

  1. md c:\temp
  2. cd c:\temp
  3. %%\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();

转载于:https://www.cnblogs.com/Stephen/archive/2005/04/21/142879.html

发表评论

表情:
评论列表 (有 0 条评论,390人围观)

还没有评论,来说两句吧...

相关阅读

    相关 how to use kvm

    kvm 是qemu 集成了一些針對開啟了VT技術的cpu而開發的不錯的內核級程式. 下面是一些簡要的說明:- <table style="border:1px solid