ComValue.SetValueFromInvokeMethod

Sets the Value property from a method call that passes it's positional arguments as an array.

Note that the array of parameters must be passed in as a COM Array.

public void SetValueFromInvokeMethod(object objectRef,
	string method,
	ComArray parms);

Parameters

objectRef
Object instance

method
Method to call

parms
An array of the parameters passed (use a ComArray Instance)

Example

*** Create an array of parameters (ComArray instance)
loParms = loBridge.CreateArray("System.Object")
loParms.AddItem(objLogin)
loParms.AddItem("Message")

*** Create a ComValue structure to hold the result: a DataSet
LOCAL loValue as Westwind.WebConnection.ComValue
loValue = loBridge.CreateComValue()

*** Invoke the method and store the result on the ComValue structure
*** Result from this method is Guid which can't be marshalled over COM
? loValue.SetValueFromInvokeMethod(loService,"Login",loParms)

*** This is your DataSet
*? loValue.Value   &&& direct access won't work  because it won't marshal

*** Now call a method that requires a DataSet parameter
loBridge.InvokeMethod(loService,"DataSetToCursors",loValue)

See also:

Class ComValue

© West Wind Technologies, 2004-2020 • Updated: 12/22/16
Comment or report problem with topic