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.