将 VB6 ActiveX 控件集成到 TCL/Tk 应用程序中

发布于 2024-08-28 06:28:20 字数 84 浏览 3 评论 0原文

在 Tcl/Tk 包装应用程序中实例化 VB6 ActiveX 控件的最常见方法是什么。

此设置(即 GDI 句柄周围)是否存在性能问题?

Whats the most common way of instantiating VB6 ActiveX controls inside of an Tcl/Tk wrapper application.

Are there performance issues with this setup i.e. around GDI handles?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜未央樱花落 2024-09-04 06:28:21
  1. 下载 ActiveTcl 发行版并安装它。
  2. 参考TclTk wiki 下载 tcl 的 tcom 库
  3. tcom README 指示将 \lib 文件夹中的 tcom 文件夹从 zip 文件复制到 C:\Tcl\lib 以安装 tcom图书馆。

现在创建一个扩展名为 .tcl 的文本文件,其中包含以下内容:

# This demo of calling the Fire method on the MyControl VB6 ActiveX control
puts "Hello World";
package require tcom;
set myinstance [::tcom::ref createobject "MyKit.MyControl"];
$myinstance Fire;

双击 .tcl 文件以使用 Wish 将其打开。

另一种选择是使用“Open Tcl”又名 optcl,它显然与 tcom 不同,它支持在基于 Tk 的应用程序中嵌入可视化 ActiveX 组件。安装方式与tcom类似(将optcl文件夹复制到C:\tcl\lib文件夹中。

以下是optcl版本的代码:

#load optcl
package require optcl
set myinstance [optcl::new MyKit.MyControl];
$myinstance Fire;
  1. Download the ActiveTcl distribution and install it.
  2. Referring to The TclTk wiki Download the tcom library for tcl
  3. The tcom README instructs to copy the tcom folder found in the \lib folder from zip file into C:\Tcl\lib to install the tcom library.

Now create a text file with the .tcl extension containing the following:

# This demo of calling the Fire method on the MyControl VB6 ActiveX control
puts "Hello World";
package require tcom;
set myinstance [::tcom::ref createobject "MyKit.MyControl"];
$myinstance Fire;

Double click the .tcl file to open it using wish.

Another option is to use "Open Tcl" a.k.a. optcl which apparently unlike tcom supports embedding a visual ActiveX component in a Tk based application. The install is similar to tcom (copy the optcl folder into the C:\tcl\lib folder.

Here is the optcl version of the code:

#load optcl
package require optcl
set myinstance [optcl::new MyKit.MyControl];
$myinstance Fire;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文