I found the problem and it has to do with the data type used. The referenced list of object instances has to be declared as a type of MS object. If I declare the variable and populate it using the following snippet it works.
$objSWbemLocator = Win32::OLE->new("WbemScripting.SWbemLocator"); $objWMIService = $objSWbemLocator->ConnectServer($strMLM,"\\root\\hewl +ettpackard\\openview\\data"); $objNodes = $objWMIService->ExecQuery("Select * from OV_ManagedNode wh +ere PrimaryNodeName like \"%$argNode%\""); my $NGList = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); foreach $fNode (in $objNodes) { print "$fNode->{PrimaryNodeName}\n"; $fNode->GetParents($NGArray, "TRUE") or die; foreach $fGrp (@{$NGArray->Value()}) { push(@nGrp, $fGrp->{Caption}); } }
In reply to Re: Problem with win32 objects
by ScooterTrash
in thread Problem with win32 objects
by ScooterTrash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |