|
|
|
|
- Overview
- How to create a procedure in C#?
- Important notes
- How to call C# classes?
- Using existing .NET assemblies
- Adding specific C# classes
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#: - 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. - The procedure is created in the code editor.
- In the header of the procedure, click "WL" to change the type of code.
- In the list that opens, select "C#".
- The header becomes light blue and "C#" appears to the left of the procedure name. The existing code is commented out.
- Write the C# code directly in the WINDEV code editor.
Remarks: - 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.
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|