This may be superfluous since I subscribe to the list in digest mode,
but just in case no one else has replied:

Kevin wrote:
[...]
>My code for a running instance, which doesn't work, looks like this:
>
>#! c:\Perl\bin\perl.exe -w
>
>use strict;
>use Win32::OLE;
>
>my $hex = Win32::OLE->GetObject('HostExplorer.Application');
>$hex ->RunCmd("Pf1");  #will update the time in window
>
>Thanks,
>Kevin
[...]
I wasn't able to call HostExplorer class by name either, but was able
to call by GUID (obtained from the registry - GUID below is for
HostExplorer for Windows NT version 6.1.0.10). I'm not familiar with
HostExplorer OLE programming (and threw this together quickly), but was
able to verify that the session count was going up, so I think I'm at
least talking to HostExplorer.

use Win32::OLE;

my $guid = "{D686594D-14EC-11cf-85D5-CA182533E812}";
my $hex = Win32::OLE->GetActiveObject($guid);
if (!$hex) {
        $hex = new Win32::OLE($guid, \&QuitApp) || die "Couldn't create
new OLE object";
} else {
        print "Using existing object\n";
}
if ($hex) {
        my $session = $hex->NewSession;
        print "$session \n";
}

sub QuitApp {
        my($ComObject) = @_;
        $ComObject->Quit();
        }


Lon McWrightman
ITG Systems Software Analyst
(503)494-0103


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to