Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COM server in Tcl

24 views
Skip to first unread message

Kevin Walzer

unread,
Aug 16, 2011, 1:07:26 PM8/16/11
to
Hi all,

I'm continuing my efforts to find the best way to present a scripting
interface for a Tcl application I am developing for Windows. I had
initially thought that DDE would be the way to go here, and indeed DDE
is simple and easy to implement, but it has a one flaw that is a
dealbreaker: there is apparently no way to access DDE from the system
Windows desktop scripting languages (i.e. VBScript). As a result, I'm
turning to implementing COM support, since VBScript has excellent
support for COM objects.

(Side note: my target audience for this support is users who might not
have another scripting language installed, such as Tcl, but make use of
the tools that come with the system. The Windows Scripting Host is
analogous to AppleScript support on the Mac, and I guess that's why
Apple is using COM for scripting iTunes on Windows.)

After surveying the options for COM support within Tcl, the one with the
best documentation is tcom. According to tcom's manual, to set up a COM
server in Tcl via tcom, one must do the following:

1. Create a COM specification file (IDL).
2. Compile that file using Microsoft's tools to create a type library.
3. Load the type library into Tcl via tcom and then proceed.

Has anyone implemented a COM server in Tcl in this fashion? Is there
another, simpler way that I am missing?

Also, has anyone implemented a COM server in Tcl in general? Are there
any production-worthy applications, commercial or open-source, that
might be worthy to study?

Thanks,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

Jeff Godfrey

unread,
Aug 16, 2011, 3:59:47 PM8/16/11
to
On 8/16/2011 12:07 PM, Kevin Walzer wrote:

> 1. Create a COM specification file (IDL).
> 2. Compile that file using Microsoft's tools to create a type library.
> 3. Load the type library into Tcl via tcom and then proceed.

Hi Kevin,

While I have very little experience with creating COM objects via Tcl I
did experiment with it once. As you mentioned, I too settled on TCOM as
the best option at the time.

I only got as far as playing with the "Banking" sample provided on the
TCOM site, but it did work as advertised. So, I think you can use that
as a guide, scale it up to suit your needs, and expect to be successful.

Jeff

0 new messages