void getTags ( System.Int32 maxSel, out System.Collections.ArrayList
sourceTagIds )
What is the correct syntax for calling this in MSH? I tried
$tagIDs = new-object System.Collections.ArrayList
$tagSel.getTags(10, $tagIDs)
which gets the error
Cannot convert argument "1", with value: "", for "getTags" to type
"System.Collections.ArrayList&": "Cannot convert
"System.Collections.ArrayList" to "System.Collections.ArrayList&"."
This method expects the caller (my MSH script here) to allocate the
ArrayList object and pass it in (by reference) to be filled, and then passed
back.
--
Marcel Ortiz [MSFT]
Monad: Microsoft Command Shell
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"forestial" <fore...@discussions.microsoft.com> wrote in message
news:017DE62C-F4EA-4F1F...@microsoft.com...
By "current drop does not support..." do you mean that it's not in the
current version of the beta, or that it will not be in the production release?
I haven't used Reflection much so I'm doing some reading on it to try to
follow your suggestion... is this something I can do in MSH or would I need
to wrap some C# code around the method in question"?
You can call the "void getTags ( System.Int32 maxSel, out
System.Collections.ArrayList sourceTagIds )" method in MSH by using
Reflection as follows:
$tagSel = new-object ...
$params = 10, $null
$tagSel.GetType().InvokeMember('getTags', 'Instance,Public,InvokeMethod',
$null, $tagSel, $params)
After that $params[1] contains the returned ArrayList.
I hope MSH is going to support this natively soon. While the reflection
technique seems extremely powerful at covering up all kinds of omissions,
it's certainly not the easiest to use....
$tagIDs = new-object System.Collections.ArrayList
$tagSel.getTags(10, [ref]$tagIDs)
--
Jeff Jones [MSFT]
Monad Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"forestial" <fore...@discussions.microsoft.com> wrote in message
news:D5A072FA-2760-4DF8...@microsoft.com...
If it's going to show up in the next beta drop. it would be awesome! ;)
--
Jeff Jones [MSFT]
Monad Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"DBMwS" <DontBother...@gmail.com> wrote in message
news:1144086941.8...@u72g2000cwu.googlegroups.com...