PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV 23 feature!
  • Overview
  • How to create a procedure in C# code?
  • Important notes
  • How to call C# classes?
  • Using existing .NET assemblies
  • Adding specific C# classes
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
You have the ability to type C# code in the WINDEV applications (Windows applications and components, .NET assemblies).
This allows you to create global procedures in C# code.
How to create a procedure in C# code?
To type the code of a global procedure in C# code:
  1. Create a new global procedure (via "New global procedure" from the popup 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. In the code editor, click the "WL" letters displayed in front of the caption of global procedure. The bar becomes light blue and the "C#" characters appear in front of the procedure name. The existing code is changed into comments.
For example:
becomes:
Notes:
  • To go back to WLanguage code, all you have to do is click "C#" in the procedure bar.
  • The name of C# procedure must contain no accented character. Otherwise, the accented characters will be deleted when switching to C# code.

Important notes

  • Passing parameters to a C# procedure is automatically done by value.
  • The parameters of procedures written in C# code must necessarily be typed with a primitive type (integer, real, string, ...). The following types are supported:
    • char
    • wchar_t
    • float
    • double
    • int
    • long
    • short
    • void
    • bool
    • BOOL
  • Avoid the comments such as "/*". The WLanguage comments ("//") are supported.
How to call C# classes?

Using existing .NET assemblies

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

Adding specific C# classes

You have the ability to include C# classes by adding ".cs" source files into the list of project elements.
  • via the list of elements
  • via the right button on "Other" in the project explorer.
Minimum required version
  • Version 23
Comments
Click [Add] to post a comment