Sets the ComValue structure to the specified Enum value.

Use this implementation instead of wwDotnetBridge::GetEnumValue() when the property, method or constructor has multiple overloads and the type conversion from enum to integer of GetEnumValue() won't find the correct member signature in .NET (Method not found error for example).

Using the COM value allows you to pass the actual Enum rather than the constant that identifies it and so the call can find the exact .NET signature.

o.ComValue.SetValueFromEnum(string enumType, string enumKeyName)


string enumType
The base type of the enumerated value. (System.Windows.Forms.MessageBoxIcon)

string enumKeyName
The actual enum value name. (OK)


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

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

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

*** Pass ComValue object to InvokeMethod

See also:

Class ComValue

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