Help / Developing and using .NET assemblies
  • Overview
  • How to create a procedure in C#?
  • Important notes
  • How to call C# classes?
  • Using existing .NET assemblies
  • Adding specific C# classes
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
You can use C# code in WINDEV applications (Windows applications and components, .NET assemblies).
This allows you to create global procedures in C#.
How to create a procedure in C#?
To write a global procedure in C#:
  1. Create a new global procedure (via "New global procedure" in the context menu of sets of procedures in the "Project explorer" pane). Specify the name of this procedure.
    Caution: the procedure name must contain no accented characters.
  2. The procedure is created in the code editor.
  3. In the header of the procedure, click "WL" to change the type of code.
  4. In the list that opens, select "C#".
  5. The header becomes light blue and "C#" appears to the left of the procedure name. The existing code is commented out.
  6. Write the C# code directly in the WINDEV code editor.
  • To switch back to WLanguage code, simply click "C#" in the procedure header and select "WLanguage".
  • The name of the C# procedure must not contain accents. Otherwise, accents will be removed when switching to C# code.

Important notes

  • In C# procedures, parameters are automatically passed by value.
  • The parameters of procedures written in C# must be of a primitive type (integer, real, string, etc.). The following types are supported:
    • char
    • wchar_t
    • float
    • double
    • int
    • long
    • short
    • void
    • bool
    • BOOL
  • Avoid commenting with "/*". WLanguage comments ("//") are supported.
How to call C# classes?

Using existing .NET assemblies

If your procedure in C# code uses C# classes, include the necessary assemblies in the project.
Remark: "using" declarations before the prototypes of C# procedures are taken into account for the entire collection.

Adding specific C# classes

You can directly integrate C# classes by adding ".cs" source files directly in the list of elements of the project:
  • via the list of elements,
  • by selecting "Other" in the right button of the project explorer.
Minimum version required
  • Version 23
Click [Add] to post a comment

Last update: 03/22/2023

Send a report | Local help