Win32 & DirectX (ActiveX and Graphs)

LANSA Version 13 SP2

Win32 & DirectX (ActiveX and Graphs)


There are compatibility issues when trying to work with both Win32 and DirectX in the same UI space. As with fonts, this is a reflection of the underlying technology.

For many customers, the adoption of DirectX may well occur in individual forms bolted on to existing applications, or perhaps as panels embedded in existing forms. This technique is fine as DirectX will work within Win32 quite happily. However, the reverse is not quite so simple, and Win32 controls don’t necessarily behave in the way one might think.

Win32 controls cannot occupy part of the same render level as DirectX and are therefore placed on a different level. This results in a situation where child Win32 controls that are bigger than their parent will cause scrolling issues. In the image below, the browser is parented to a panel which has been scrolled. See how the top of the browser coincides with the top of the panel scroll bar on the right. As this is a Win32 application, the browser is correctly clipped.

The code for this form is available in the Sample Source section of this document.

However, in the same form running as DirectX (below), scrolling the panel causes the ActiveX to move, but not to clip. See how the browser is now above the panel scrollbar on the right.


The only practical solution to this issue is to ensure that the Win32 control is sized appropriately, probably by use of a layout manager, and does not exceed the size of its parent.

As at the time of release of this document, Memo (Prim_memo) and Listview (Prim_ltvw) are still Win32 controls.