> -----Original Message----- > From: perl-win32-users-boun...@listserv.activestate.com > [mailto:perl-win32-users-boun...@listserv.activestate.com] On > Behalf Of Michael Ellery > Sent: Friday, December 04, 2009 11:59 AM > To: Michael > Cc: perl-win32-users@listserv.ActiveState.com > Subject: Re: WIN32::OLE WMI Out params > > I haven't followed your thread closely, but it seems like the > relevant bits from your first link are these: > > my $objSecDescriptor = Win32::OLE::Variant-> new > (VT_DISPATCH|VT_BYREF); my $retval = > $objDirectorySecSetting->GetSecurityDescriptor($objSecDescriptor); > > ..which seems to be filling the $objSecDescriptor with an out param. > > If your out param is an array, you might need to add VT_ARRAY > to the variant flags when you create it. Does something like > that work for you ? > > -Mike > > Michael wrote: > > Hi Steven, > > > > Well I tried your suggestion and I think that the > Win32::OLE::Variant > > module might be the solution, as I have found some other examples > > where WMI [out] and variants are used. > > > > > http://www.infoqu.com/dev/perl-programming/using-perl-with-wmi-to-set- > > folder-level-permissions-16930-1/ > > http://www.perlmonks.org/?node_id=325823 > > > > However I'm in way over my head here, so unless someone > could cut it > > out in pieces , I don't think that I'll get any further. > > > > /Michael > > > > > > On Fri, 4 Dec 2009 02:12:03 -0700, "Steven Manross" > > <ste...@manross.net> > > wrote: > >> Below... > >> > >>> -----Original Message----- > >>> From: perl-win32-users-boun...@listserv.activestate.com > >>> > [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf > >>> Of Michael > >>> Sent: Thursday, December 03, 2009 6:45 AM > >>> To: perl-win32-users@listserv.ActiveState.com > >>> Subject: RE: WIN32::OLE WMI Out params > >>> > >>>> When troubleshooting OLE issues, it is best to have the > >>> following code > >>>> after each OLE command... > >>>> > >>>> If (Win32::OLE-> LastError() != 0) { > >>>> print "error calling blah: " . Win32::OLE-> LastError() . "\n"; > >>>> exit 0; > >>>> } > >>>> > >>>> ...Or something similar, so you can see what OLE had issues > >>> with (if > >>>> anything). It might lead you in a direction that fixes it. > >>>> > >>>> Steven > >>> Added to the script, but no issues reported. > >>> > >>> /Michael > >> Well, then my next guess is the use of the Variant module > (because no > >> error is thrown from OLE). > >> > >> Some OLE calls require to be cast of a certain type before > they work. > >> > >> my $nodes = Variant(VT_ARRAY|VT_VARIANT, 0);
My apologies here.. I think that I misstated the way to call it. Put this at the top somewhere... use Win32::OLE::Variant; Add the following before your GetChildNodes call. Thanks go to Michael Ellery for making me see that mistake as I did not test this code before sending it off. my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); By adding this before your GetChildNodes call, you should be all set (Variant-wise) However, before you give up after trying the above call (if it does not work as stated above), I would replace: "VT_ARRAY|VT_VARIANT" With "VT_VARIANT" And also try.. (if the previous does not work) "VT_ARRAY|VT_BSTR" And lastly try his example from the SecurityDescriptor call.. "VT_DISPATCH|VT_BYREF" ...in my code above. As well, you might try sticking the VT_BYREF as another ORed option to each of the above examples like in Michael Ellery's example.. i.e. VT_ARRAY_|VT_BSTR|VT_BYREF or VT_VARIANT|VT_BYREF or VT_ARRAY|VT_VARIANT|VT_BYREF HTH Steven > >> > >> #I might also try VT_VARIANT or VT_ARRAY|VT_BSTR instead of > >> VT_ARRAY|VT_VARIANT > >> > >> #then > >> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, TRUE); > >> > >> Play around with this... I'm not the greatest Variant > script writer > >> here, to know exactly which combination will work (if this is it) > >> based on the object type as I've only run into this a few times > >> before, but you can get examples from your perl install here > >> (depending on your perl build version) of similar options > to try and all the VT_* types: > >> > >> C:\Perl\html\lib\Win32\OLE\Variant.html > >> > >> HTH > >> > >> P.S. I googled OV_NodeGroup and found someone else with your same > >> problem on an HP board (or so it seems). :( > >> > >> Steven > >> > >>> _______________________________________________ > >>> Perl-Win32-Users mailing list > >>> Perl-Win32-Users@listserv.ActiveState.com > >>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > >>> > > _______________________________________________ > > Perl-Win32-Users mailing list > > Perl-Win32-Users@listserv.ActiveState.com > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > > _______________________________________________ > Perl-Win32-Users mailing list > Perl-Win32-Users@listserv.ActiveState.com > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs