in reply to Re: Perl for OLE & OCX
in thread Perl for OLE & OCX
use strict;
use Win32::OLE;
use Win32::OLE::Const;
my $HALi;
# Create a new OLE object using the Root Name of HALiCnt.HALi
$HALi = Win32::OLE->new('HALiCnt.HALi') ||
die "Cannot create COM server HALiCnt.HALi";
if (Win32::OLE->QueryObjectType($HALi) eq "_HALi"){
print "Successful Com Server creation\n";
}
my $c = $HALi->{'Modes'}->Count();
print $c;
$HALi->DESTROY(); # Call DESTROY to free memory and release the HALi Objects
print "Last OLE Error detected.. ";
print Win32::OLE->LastError();
I have also spent hours with the OLE Browser and OLEView. The object is created successfully, verified, and destroyed all with no errors. But when I try to retrieve Count, it croaks. I have tried many, many variations on the call to Modes.Count. The VB example is simply HALi.Modes.Count but I can't make the Perl translation work. If I had VB I'd try it to verify *IT* works, but I think the proper answer is the lack of IDispatch interface, which I guess means I'm dead.
Thanks for the help
Nathan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl for OLE & OCX
by NetWallah (Canon) on Jun 16, 2004 at 19:26 UTC | |
by wa4otj (Beadle) on Jun 16, 2004 at 21:23 UTC |