translated like this:Dim pcbApp Set pcbApp = GetObject(, "MGCPCB.ExpeditionPCBApplication") Dim pcbDoc Set pcbDoc = pcbApp.ActiveDocument Dim key key = pcbDoc.Validate(0) Dim licenseServer Set licenseServer = CreateObject("MGCPCBAutomationLicensing.Applicatio +n") Dim licenseToken licenseToken = licenseServer.GetToken(key) msgbox licenseToken
The vbs code runs and displays the licenseToken at the end. The perl code fails withuse strict; use warnings; use Win32::OLE; my $pcbApp; eval {$pcbApp = Win32::OLE->GetActiveObject('MGCPCB.ExpeditionPCBAppli +cation')}; die "Expedition not installed" if $@; die "Expedition not running" unless defined $pcbApp; my $pcbDoc = $pcbApp->ActiveDocument; die "No active document." unless $pcbDoc; my $key = $pcbDoc->Validate(0); my $licenseServer = Win32::OLE->new('MGCPCBAutomationLicensing.Applica +tion'); die "Automation license acquisition failed: " . Win32::OLE::LastError( +) unless defined $licenseServer;
Using 'CreateObject' instead of 'new' doen't change anything (from the docs I expect them to be equivalent). Any idea how to track down the source of this error?Automation license acquisition failed: Win32::OLE(0.1709) error 0x8007 +007e: "The specified module could not be found"
Wolfram
In reply to Win32::OLE -- translation from vbs to pl by whumann
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |