User Tools

Site Tools


DK for ActiveX

Documentation | Known issues | DK for ActiveX


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 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.

Using references to visual controls in API

Due to ActiveX limitation controls presented in API, they are not exactly pure OCX objects but are some wrapper around. While it is obvious in .NET such behavior is a bit hidden in VB6. To access the underlying OCX object, please use:


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())

Themes for Windows common controls and dialogs

A Manifest file is required to enable proper Windows styling of the application created with Visual Studio. 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) -->

Manifest is Windows not Visual Studio specific, so it should also be applied on applications created in other environments.

Windows XP

  • Versions 11.24 and newer crashes immediately in Windows XP. The problem is resolved on 11.32.0-Unstable4 or newer.
2024/03/04 10:10

Page Tools