When moving that control to X# I have followed the recipes from the samples, but this one needs the license key passed as second parameter to CreateEmbedding in VO.
How can I pass that license string to my control object in X#?
Thank you very much!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Wolfgang,
Usually if you add an activeX to a windows form then a file Licenses.Licx will be added to your project. This will be included as resource in your project. And the ActiveX control will also persist its state including the license information in the form.resx file.
So you don't have to specify the key..
If that does not work then this is the code (in C#) that retrieves the private property of the AxHost (the host of the ActiveX control) and sets the key:
System.Reflection.FieldInfo f =
typeof(AxHost).GetField("licenseKey",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance);
f.SetValue(oActiveXControl, "license-here");
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Hi Robert,
yes, I think so. But hopefully I have a chance to do without it because in the migrated VO application there is no painted WinForms form.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it