Using LL.ocx from .NET

I’m working on migrating an old VB6 application to .NET/WinForms/C#. The application uses List&Label pretty extensively. Because of the differences in the List&Label’s ActiveX and .NET APIs, I’d like to keep using the ocx for now. I’m aware it’s not recommended, this is meant to be the first migration step for the application.

Referencing the cmll22o.ocx works fine, the Interop.ListLabel.dll and AxInterop.ListLabel.dll are generated and can be used very similarly to how it was used in the original VB6 application, I can open reports etc.

Similarly, Interop and AxInterop dlls are generated for the cmll22fx.ocx and can be used.

Trouble starts when I connect a DesignerFunction with the ListLabel object, doing it the same way VB6 does it: axDesignerFunctions1.ParentComponent = LL;

Calling LL.Design(0, 0, "Title", ListLabel.LlProjectConstants.LL_PROJECT_LIST, "", 0) now breaks, where previously it would show the LL designer as expected. The exception is Managed Debugging Assistant 'InvalidVariant'.

If instead of AxCMLL22FXLib.AxDesignerFunctions I use the CMLL22FXLib.DesignerFunctions (i.e. loose the AxHost wrapper), setting the func.ParentComponent = LL; works, and the function appears in the LL designer’s function list. But when I add an event handler for the func.EvaluateFunction, I get the same InvalidVariant exception again.

At this point, I’m completely lost. Any help would be appreciated.

Actually, you should migrate from using the OCX to using the NET component. It offers way more features, doesn’t require any registration and is superior in every way. The issue sounds like there’s something wrong when marshaling values between both worlds - we haven’t tested this scenario.

Is there a migration guide somewhere? I’m struggling with finding correct equivalents for various things, unfortunatelly.

Feel free to describe what you were looking for here - usually you should be able to work with the same APIs, although switching to data binding will open up a whole world of additional features.