in reply to Problem with win32 objects
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}); } }
|
|---|