ComValue.SetValueFromProperty

Sets the Value property from a property retrieved from .NET Useful to transfer value in .NET that are marshalled incorrectly in FoxPro such as Enum values (that are marshalled as numbers).

public void SetValueFromProperty(object objectRef,
	string property);

Parameters

objectRef
An object reference to the base object

property
Name of the property

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, 1996-2022 • Updated: 12/22/16
Comment or report problem with topic