Creating and using .NET Value Types in FoxPro

.NET Value types are problematic in FoxPro, because they cannot be passed over COM to FoxPro in any way. This means it's impossible to directly create, return or assign a .NET Value in FoxPro.

There are 3 ways how you can use value types in FoxPro

  • Access via GetProperty()/GetPropertyEx()
  • Assigning via CreateInstanceOnType()
  • Using ComValue.SetValueFromCreateInstance()

Access via GetProperty()/GetPropertyEx()
If you need to access a value type on an existing object, you can access it by using the indirect activation methods of wwDotnetBridge. GetProperty() and GetPropertyEx() allow you to access a value type member and return a direct value from it or value

© West Wind Technologies, 2023 • Updated: 10/21/22
Comment or report problem with topic