Sets the value property from a static 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 SetValueFromStaticProperty(string typeName,
	string property);


Full type name as a string - can also be an Enum type

The static property name


*** Main object we're working with
loWager = loProxy.oBridge.CreateInstance("WageringService.Wager")

*** Want to assign to Modifier property of type Nullable<WagerModifier> 
*** which is an Enum value (ie. static field value). Normally Enums
*** work as numbers but because it's of Nullable<T> the EXACT 
*** Enum type is required

*** Use ComValue object to hold the Enum value
LOCAL loComValue as Westwind.WebConnection.ComValue
loComValue = loBridge.CreateInstance("Westwind.WebConnection.ComValue")

*** Get the static Enum Value and assign to ComValue

*** Pass ComValue object to SetProperty to assign (or in InvokeMethod())

See also:

Class ComValue

© West Wind Technologies, 1996-2024 • Updated: 12/22/2016
Comment or report problem with topic