AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar y utilizar ensamblados .NET
  • Overview
  • Integrating a .NET assembly in a WINDEV or WEBDEV project
  • Using elements of the .NET assembly
  • Limitations
  • Incompatibilidad entre ActiveX de IE (y oAuth2) y el uso de ensamblados .NET
  • Using standard .NET Framework 4 assemblies (and below)
  • Using standard .NET Framework 4 assemblies (and below)
  • Using standard assemblies of .NET 5 SDK
  • Using a .NET assembly created with WINDEV
  • List of .Net assemblies used in the project
  • Reloading the .NET assemblies
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
.NET technology is Microsoft's software development platform. This .NET platform simplifies the development of distributed object applications whose modules communicate via the Internet.
This help globally explains how to use the .NET technology in WINDEV, WINDEV Mobile and WEBDEV. For more details, see a specific documentation.
Integrating a .NET assembly in a WINDEV or WEBDEV project
To integrate .NET assemblies into the current project:
  1. On the "Proyecto" tab, in the "Proyecto" group, expand "Importar" and select "A .NET assembly"
  2. In the window that appears, select the .NET assemblies to be integrated into the current project.
    • A "Search" area allows you to easily find the desired assembly.
    • The "Select from disk" button allows you to select an assembly that does not appear in the list. The assembly selected via the "Select from disk" button is automatically selected and appears at the top of the list.
    • The "Fill list automatically" button searches for all assemblies available on the computer.
    • If necessary, specify the targeted .NET framework. The list shows the different Microsoft versions. The "Automatic" option is selected by default.
      Note: The list of assemblies may vary depending on the targeted .Net framework.
      Novedad versión 2025
      .NET assemblies 9 now available.
      Attention This feature is only available from version 2025 Update 2.
  3. Validate. The selected assemblies are imported.
Using a .NET assembly is equivalent to using a class in WLanguage.
Reminder: Classes are shown in the "Project explorer" pane. The .NET classes are grouped by "Namespace".

Using elements of the .NET assembly

The following elements imported into the .NET assembly can be handled in WLanguage:
  • Delegates. You can manipulate delegates using the DotNetDelegate function.
    You also have the ability to add a delegate with the += operator:
    clDotNet is ClassEventManagement
    // Branch the event
    clDotNet:m_LogHandler += Proc_Test
    // ...
    // Triggers the event
    clDotNet:SendAMessage("String sent")
    //-------------------------------------------------
    // Manage the event
    PROCEDURE Proc_Test(src, args)
    Info("The string passed as parameter via the delegate is " + args:get_Message())
  • NestedType with more than 1 level
  • Reference
  • Properties
  • Array with more than 1 dimension
  • Structures.
  • Enums.
    You have the ability to combine the Enum coming from .Net assemblies via &, | , ||, ~ . You have the ability to convert the enums into integers or to build them from integers.
  • Internal classes. The syntax to be used is as follows:
    <Object name> is "<Class name>"

    The syntax without quotes is also available:
    <Object name> is <Class name>

    Example:
    O is "ExternalClass.InternalClass"

    O is ExternalClass.InternalClass
  • Generic:
    The following syntax is used to instantiate a generic:
    <Object name> is "<Generic name><<Concrete type>>"
    Example for instantiating a generic:
    MyList is List<CMyObject>"
  • Generic methods:
    The following syntax is used to call a generic method:
    <Object name>."<Name of generic method><<Concrete type>>"(<parameters>)
    Example for calling a generic method:
    // Prototype of the generic CloneList method of CClone class
    // CloneList(List<T>)
    // ...
    MyList is List<int>"
    // ...
    clClone is CClone
    MyListCopy is List<int>" <- clClone."CloneList<int>"(MyList)
  • Extension methods:
    The extension methods can be called like the methods of the object.
When possible, the WLanguage types are implicitly converted into .Net types.
Example:
clDotNetString is "String" dynamic
sWLString is string = "string"
clDotNetString = sWLString

Limitations

  • A WLanguage class cannot be derived from a .NET class.
  • The following types are supported:
    • Date/Time
    • WINDEV currencies. In output, the WINDEV currencies are converted into decimal numbers.
    • Decimal numbers
      A decimal parameter passed from a .NET assembly to a WLanguage function is converted into currency if possible. If this conversion is not possible, the parameter is converted into double.
    • Structures
  • The objects derived in .NET from an exported WLanguage class are not supported. If an object of this type is passed to a WLanguage function as parameter, it is "casted" into the base WLanguage type.
  • Passing pointer parameters between WLanguage and .NET is not supported.
  • The "structure" members found in classes and/or in sets are not visible in .NET because the WLanguage structures are not visible in .NET. To fix this problem, create a class containing the code of the structure.
  • The "class" members found in classes and/or in sets are visible in .NET only if the class is exported as well.
  • Caution: Components created with version 11 (or earlier) that use .NET will no longer work with version 2025. It is necessary to generate the components again with version 2025.
WINDEV

Incompatibilidad entre ActiveX de IE (y oAuth2) y el uso de ensamblados .NET

Cuando se utiliza un control HTML en WINDEV, este control utiliza el sistema ActiveX "Microsoft Web browser". WINDEV también utiliza ActiveX para todas las autenticaciones OAuth2 (Facebook, Twitter, Google, etc.) que requieren una validación de la conexión mediante código HTML.
Si utiliza un control HTML (o la autenticación OAuth2) y un ensamblado ".Net" en el mismo proyecto, puede encontrar problemas de compatibilidad entre las capas .NET de Microsoft y el entorno de software ActiveX.
Se puede utilizar una API para gestionar ambas tecnologías. Para ello, escriba la siguiente línea de código en el código de inicialización del proyecto o en el código de inicialización de una clase o procedimiento global si el objeto ".Net" se inicializa en una clase o en un conjunto de procedimientos:
// Used to manage the cohabitation between IE ActiveX and .NET
API("OLE32", "CoInitializeEx", Null, 2)
Using standard .NET Framework 4 assemblies (and below)

Using standard .NET Framework 4 assemblies (and below)

To use standard .NET Framework 4 assemblies (and below):
  1. Select the ".NET assemblies" folder in the "Project Explorer" pane.
  2. Open the context menu and select "Use a .NET assembly".
  3. In the window that appears, click "Rellenar automáticamente una lista con los ensamblados .NET del disco. Atención: Este proceso puede durar mucho tiempo.".
  4. Select the standard assemblies to use (mscorlib.dll or another assembly).
  5. Validate.

Using standard assemblies of .NET 5 SDK

To use standard assemblies of .NET 5 SDK:
  1. Select the ".NET assemblies" folder in the "Project Explorer" pane.
  2. Open the context menu and select "Use a .NET assembly".
  3. In the window that appears, click "Seleccionar los ensamblados .NET en el disco...".
  4. Select the installation directory of the .NET 5 SDK. For example:
    "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0".
  5. Select the standard assemblies to use (System.Runtime.dll or another assembly).
    Caution, this directory contains the mscorlib.dll file. This file must not be selected if the .NET 5 SDK is used.
  6. Validate.
Using a .NET assembly created with WINDEV
The assemblies generated by WINDEV can be used like any other .NET assembly. However, the WINDEV framework and the assembly must be found in the same directory.
List of .Net assemblies used in the project
To display the list of .Net assemblies used in the project, you can:
  • On the "Proyecto" tab, in the "Proyecto" group, expand "Lista de elementos" and select "List of .NET assemblies used".
  • In the "Project explorer" pane, select "List of .NET assemblies used in the project" in the context menu of ".NET assemblies".
Reloading the .NET assemblies
You can reload the .NET assemblies used in the project to take into account a change made to an assembly since the project was opened.
  1. In the "Project explorer" pane, select ".NET assemblies".
  2. In the context menu of this element, select "Reload .NET assemblies".
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 13/05/2025

Señalar un error o enviar una sugerencia | Ayuda local