PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Using .net custom control in WinDev
Using .net custom control in WinDev
Débuté par Midhunlal G, 21 sep. 2018 13:02 - 4 réponses
Posté le 21 septembre 2018 - 13:02
Folks,

We are trying to integrate TX Text Control .NET into WinDev application. There is a license file associated with the TX Text Control (.licx extension file ). So when WinDev tries to load the control, it fails to load the license file and ends up in a exception.

Stack Trace:
Error at line 2 of End of initialization of EXPRESS_TxtControl process.
Error returned by .NET Framework:
Exception has been thrown by the target of an invocation.

----- Technical Information -----

Project : EXPRESS_TxtEdtControl

WL call:
Process of 'End of initialization of EXPRESS_TxtControl' (EXPRESS_TxtControl), line 2, thread 0

What happened?
Error returned by .NET Framework:
Exception has been thrown by the target of an invocation.

Error code: 200007
Level: fatal error

Dump of the error of 'wd230net4.dll' module (23.0.6.0).
Identifier of detailed information (.err): 200007
Debugging information:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.LicenseException: The following control could not be licensed: TXTextControl.TextControl
at ᜁ.᜿.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at TXTextControl.TextControl..ctor()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at CDotNetType.vpgcrInvokeConstructor(CDotNetType* , ConstructorInfo pclConstructorInfo, CSLevel* pclPile, Int32 nNbParamPile, STOperationDotNet* pstOperation)
at CDotNetType.vpgcrInvokeConstructor(CDotNetType* , STMethodeDotNet* pstMethode, UInt32* pdwIdentifiant, CSLevel* pclPile, Int32 nNbParamPile, STOperationDotNet* pstOperation)
at CDotNetInstance.bExecuteConstructeur(CDotNetInstance* , STMethodeDotNet* pstMethode, UInt32* pdwIdentifiant, CSLevel* pclPile, Int32 nNbParamPile, STOperationDotNet* pstOperation)
Additional Information:
EIT_PILEWL :
End of initialization of EXPRESS_TxtControl (EXPRESS_TxtControl), line 2
EIT_DATEHEURE : 21/09/2018 16:29:04
EIT_TYPE_WDFILE : <2>
EIT_IDCODE : <34>

How to handle this situation? How can we condifgure WinDev to load this license file? Any help is much appreciated.

Thanks in advance!
Midhun
Membre enregistré
6 messages
Popularité : +1 (1 vote)
Posté le 21 septembre 2018 - 16:21
Hello All,

Hooray! Got it working!

Created a 'custom control AP'I in .Net that inherits the actual TextControl. Crucial step is to add 'licences.licx' as an embedded resource to the API. Use this new custom control in Windev.

using TXTextControl; //TXTextControl.Windows.Forms.dll

namespace TxtControlLib
{
    public class TxtControl: TextControl
    {

    }
}



happy coding!
mlg
Membre enregistré
102 messages
Popularité : +2 (2 votes)
Posté le 25 septembre 2018 - 14:06
Dude,

are you trying to work with .NET components from DevExpress? Now you got my interest.

How do you handle those components, e.g. how do you read the input of the TxtControl?

And what do you mean with 'add licences.licx as an embedded resource to the API'?

TIA
Sebastian

--
http://arnoldconsult.de
WinDev 21 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL
Membre enregistré
6 messages
Popularité : +1 (1 vote)
Posté le 26 septembre 2018 - 09:33
Oh, My bad. Unfortunately I can't edit previous answer. It's not a API, it's a custom user control developed in .Net framework.

Please read this part "add 'licences.licx' as an embedded resource to the API" => "add 'licences.licx' as an embedded resource to the custom control DLL"

Here you go, https://ibb.co/dTNqHU (Visual Studio Editor)

This is the control, https://www.textcontrol.com/.
Message modifié, 26 septembre 2018 - 09:35
Posté le 29 mai 2019 - 16:49
Hello mlg,
I have the same problem, but I can't get it to work. :( Despite embedded licenses.licx I get the error that no license was found.
Is your workaround valid for WinForms or WPF ?
Regards
Frank