If text field contains an empty string then return value on all platforms should be just an empty string. However, if used in .NET, the returned value is empty. This is not our fault - .NET simply interprets a COM Variant object with an empty string as an Object with a null value. Therefore we suggest using a null-safe construct like:
mystring = shape.GetField("MYFIELD")?.ToString()' if ( mystring == null ) mystring = "";
In this code the “?” character is crucial. The “mystring”“ value still can be null, but at least there will be no runtime error upon conversion.
Due to ActiveX limitation controls presented in API are not the exactly pure OCX objects but it is some kind of wrapper around. While it is obvious in .NET such behavior is a bit hidden in VB6. To access underlying OCX object please use: VB6
Legend.GIS_Viewer = GIS.Object Scale.GIS_Viewer = GIS.Object Dim lgndfrm as New TGIS_ControlLegendForm lgndfrm.ShowLayerProperties layer, Legend.Object
Legend.GIS_Viewer = GIS.GetOcx() Scale.GIS_Viewer = GIS.GetOcx() (New TGIS_ControlLegendForm).ShowLayerProperties( layer, Legend.GetOcx())
To enable proper windows styling of the application created with Visual Studio a Manifest file is required. To do this add a default manifest file to the app and uncomment section:
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="220.127.116.11" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency>
Manifest is Windows not Visual Studio specific, so it should be applied on application created in other environments as well.