<tfoot id='zibGK'></tfoot>

    <legend id='zibGK'><style id='zibGK'><dir id='zibGK'><q id='zibGK'></q></dir></style></legend>

      <small id='zibGK'></small><noframes id='zibGK'>

          <bdo id='zibGK'></bdo><ul id='zibGK'></ul>
      1. <i id='zibGK'><tr id='zibGK'><dt id='zibGK'><q id='zibGK'><span id='zibGK'><b id='zibGK'><form id='zibGK'><ins id='zibGK'></ins><ul id='zibGK'></ul><sub id='zibGK'></sub></form><legend id='zibGK'></legend><bdo id='zibGK'><pre id='zibGK'><center id='zibGK'></center></pre></bdo></b><th id='zibGK'></th></span></q></dt></tr></i><div id='zibGK'><tfoot id='zibGK'></tfoot><dl id='zibGK'><fieldset id='zibGK'></fieldset></dl></div>

        如何在 C# 中创建 ActiveX 控件?

        How to create an ActiveX control in C#?(如何在 C# 中创建 ActiveX 控件?)
      2. <legend id='6P2hm'><style id='6P2hm'><dir id='6P2hm'><q id='6P2hm'></q></dir></style></legend>

            <tbody id='6P2hm'></tbody>

            <small id='6P2hm'></small><noframes id='6P2hm'>

            1. <tfoot id='6P2hm'></tfoot>
                  <bdo id='6P2hm'></bdo><ul id='6P2hm'></ul>
                  <i id='6P2hm'><tr id='6P2hm'><dt id='6P2hm'><q id='6P2hm'><span id='6P2hm'><b id='6P2hm'><form id='6P2hm'><ins id='6P2hm'></ins><ul id='6P2hm'></ul><sub id='6P2hm'></sub></form><legend id='6P2hm'></legend><bdo id='6P2hm'><pre id='6P2hm'><center id='6P2hm'></center></pre></bdo></b><th id='6P2hm'></th></span></q></dt></tr></i><div id='6P2hm'><tfoot id='6P2hm'></tfoot><dl id='6P2hm'><fieldset id='6P2hm'></fieldset></dl></div>
                • 本文介绍了如何在 C# 中创建 ActiveX 控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我无法在 C# 中创建功能正常的 ActiveX 控件;我已尝试按照教程进行操作,但没有成功.

                  I am not able to create a functioning ActiveX control in C#; I have tried following tutorials to do so without success.

                  我创建了一个包含以下代码的示例类库项目:

                  I create a sample Class Library project which includes this code:

                  namespace AACWCSurvey
                  {
                      [ProgId("Prisoner.PrisonerControl")]
                      [ClassInterface(ClassInterfaceType.AutoDual)]
                      public class Class1
                      {
                          public Class1()
                          {
                              MessageBox.Show("FIRETRUCK!!!");
                          }
                      }
                  }
                  

                  然后我做了以下步骤:

                  1. 属性 => 应用程序 => 程序集信息 => 使程序集 COM 可见
                  2. Build => 注册 COM 互操作 TRUE(选中)
                  3. 为程序集创建强名称(签名)
                  4. 构建项目
                  5. regasm MyDll.dll/tlb/codebase

                  在 tstcon32 中看不到 Prisoner.PrisonerControl =(

                  Can't see Prisoner.PrisonerControl in tstcon32 =(

                  我的操作系统是 WinXP x86.

                  My OS is WinXP x86.

                  UPD: 它适用于 VBScript:

                  UPD: it works from VBScript:

                  Dim objJava
                  Set objJava = WScript.CreateObject("Prisoner.PrisonerControl")
                  

                  但在 tstcon32 中不可见.

                  but it is not visible in tstcon32.

                  推荐答案

                  如果您阅读 使用 Prisoner.PrisonerControl 控件的实际文章 使用您的控件 GUID 在该键内创建名为 Control 的子键.

                  If you read the actual article using the Prisoner.PrisonerControl control a sub key named Control is created inside the key with your control GUID.

                  在我的机器上使用 guid {9DEA5F06-E324-31A7-837B-D0F3BDE91423} 创建密钥

                  On my machine with the guid {9DEA5F06-E324-31A7-837B-D0F3BDE91423} creating the key

                  HKEY_CLASSES_ROOTCLSID{9DEA5F06-E324-31A7-837B-D0F3BDE91423}Control
                  

                  使控件出现在 tstcon32 中.无论有没有它,ActiveX 都可用于 javascript

                  Make the control appears in tstcon32. And with or without it the ActiveX is usable for javascript

                  var x = new ActiveXControl("Prisoner.PrisonerControl");
                  

                  <小时>

                  实际上,我不得不在 javascript 执行和注册表路径上都与 windows 作斗争才能在我的系统上对其进行测试,因为它是 x64 机器,但那是另一回事了.

                  这篇关于如何在 C# 中创建 ActiveX 控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)
                • <legend id='r1Tg5'><style id='r1Tg5'><dir id='r1Tg5'><q id='r1Tg5'></q></dir></style></legend>
                    <bdo id='r1Tg5'></bdo><ul id='r1Tg5'></ul>

                      <i id='r1Tg5'><tr id='r1Tg5'><dt id='r1Tg5'><q id='r1Tg5'><span id='r1Tg5'><b id='r1Tg5'><form id='r1Tg5'><ins id='r1Tg5'></ins><ul id='r1Tg5'></ul><sub id='r1Tg5'></sub></form><legend id='r1Tg5'></legend><bdo id='r1Tg5'><pre id='r1Tg5'><center id='r1Tg5'></center></pre></bdo></b><th id='r1Tg5'></th></span></q></dt></tr></i><div id='r1Tg5'><tfoot id='r1Tg5'></tfoot><dl id='r1Tg5'><fieldset id='r1Tg5'></fieldset></dl></div>
                        <tbody id='r1Tg5'></tbody>
                    • <small id='r1Tg5'></small><noframes id='r1Tg5'>

                      1. <tfoot id='r1Tg5'></tfoot>