Parameter and SetValue and Return Value and GetProperty Type Fixups
When you use wwDotnetBridge's
SetProperty() these Reflection wrappers in some cases fix up the input parameters and return values to mapped types to make it easier to access them from FoxPro.
There are two fix up mechanisms:
- Fix up method Return Values and GetProperty() results
- Fix up Parameters or SetProperty calls
When you call a method with
InvokeMethod() or get a property value with
GetProperty() some result values are automatically fixed up.
The following describes how values are fixed up:
|.NET Type||Returned As|
|Guid||ComGuid wwDotnetBridge Wrapper|
|Long/Int64||FoxPro Decimal (Y)|
|char||FoxPro String (C(1))|
|Array||ComArray wwDotnetBridge Wrapper|
||ComArray wwDotnetBridge Wrapper|
When you call a method via
InvokeMethod() and pass parameters, or when you call
SetProperty() to assign a value, the input value you pass from FoxPro is fixed in some cases as FoxPro cannot easily pass certain types to .NET including Value types, generic types, arrays and collections, Guids and more.
|FoxPro Type||.NET Type|
|.NULL. or Null||DbNull|
|ComArray||fixed up to
|ComValue||fixed up to
|ComGuid||fixed up to
You may notice the
ComGuid objects in the lists above. These are wwDotnetBridge helper objects that wrap .NET types with an internal instance, and methods that allow FoxPro to manipulate the object or structure which would otherwise not be directly possible using direct COM access.
The most common use case likely is using the ComArray class to create a .NET array and pass it to .NET. ComArray lets you create and edit .NET arrays inside of .NET without ever having to pass the actual array to FoxPro - instead you can access the individual items in the array - or collection - using the ComArray methods.
Additionally you may also run into types that are not supported in FoxPro or don't translate properly to .NET via COM. ComValue has helper methods that allow you to create a number of common .NET types and constructs from FoxPro values or structures that can then be passed to .NET. Most commonly when you encounter a type that's not supported you can work around the issue the ComValue class by assigning a FoxPro value to this class using one of the supported helper methods.
Comment or report problem with topic