[APN] 2006-09-05 [TWAPI] has some experimental (in CVS but not in any release) COM client support. Example: package require twapi set ie [twapi::comobj InternetExplorer.Application] ;# Start Internet Explorer $ie Visible 1 ;# Make it visible $ie Navigate http://www.google.com ;# Go to Google after 10000 ;# Wait so you can see it $ie Quit ;# exit IE $ie -destroy ;# Destroy the COM object See [TWAPI and WMI] for some more examples. ---- '''Motivation''' Why another COM package when we have all the other options listed in [COM] ? [TWAPI]'s COM support is limited and is not intended to compete with [optcl] or [tcom]. It was added to allow [TWAPI] access to some of the simpler COM based API's in Windows including WMI and ADSI without having to carry around another 300K of [tcom] only part of which would actually be used. Some limitations include: * Client side only - no server support * No support for binding to events and callbacks There are a couple of features in [TWAPI] that [tcom] and [optcl] do not have which improve usability. * A generalized -with option that allows navigation through a method path without having to manually create intermediate objects * Support for dynamically created COM properties and methods (IDispatchEx interface) which makes it easier to access COM classes like those in WMI. See the [TWAPI and WMI] page for examples. ---- Here is the [TWAPI] WMI form of the [tcom] example from [Matthias Hoffmann - Tcl-Code-Snippets - tcom & wmi - Examples] proc readPopUps {} { set res {} set wmi [twapi::_wmi] set wql {select * from Win32_NTLogEvent where LogFile='System' and \ EventType='3' and \ SourceName='Application Popup'} set svcs [$wmi ExecQuery $wql] # Iterate all records $svcs -iterate instance { set propSet [$instance Properties_] # only the property (object) 'Message' is of interest here set msgVal [[$propSet Item Message] Value] lappend res $msgVal } return $res }