Lieven De Foor (b-inside) asked a question.

Using a .NET UserControl in classic ABL GUI?

Hi,

 

Has anyone succeeded in using a .NET UserControl in classic ABL GUI?

There are supposed to be ways to create COM wrappers for .NET controls (https://docs.microsoft.com/en-us/dotnet/framework/interop/how-to-create-com-wrappers) and even Telerik has some documentation on it (https://docs.telerik.com/devtools/winforms/knowledge-base/wrapping-a-net-user-control-as-an-activex) but we haven't succeeded in getting this to work in classic ABL.

In particular, trying to add an OCX to the AppBuilder design canvas does not seem to show our newly registered COM wrapped control in the selection list. Manually browsing to the .tlb file and trying to open it returns an error.

Anyone with more succes?

Or are we trying something that is not technically possible?


Peter Judge likes this.
  • Mike Fechner (Consultingwerk)

    Not a straight answer to your question. But what we usually do is to embed the ABL window in the GUI for .NET Window Container so that the ABL Window is in a .NET Form. And then we place .NET Controls in the same form (partially) overlapping the Window Container/ABL window.

  • Lieven De Foor (b-inside)

    Microsoft used to ship a tool called TstCon32 (ActiveX Control Test Container) with Visual Studio in which you can test your OCX's.

    It is no longer supplied but I was able to build it using https://gitlab.com/dalevine/TstCon32

    When running you can insert any registered OCX, using a UI that resembles the OCX selection UI from AppBuilder.

    What's immediatelly apparent is that the list is a lot longer in this application, and I can choose my custom (or Teleriks example) control, and that seems to work fine as ActiveX from there!

    So there must be some other rules that AppBuilder is applying to decide to show and/or be able to use a perfectly valid OCX...