PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to create the different types of libraries?
  • Creating the main library
  • Creating the secondary projects and the secondary libraries
  • Including secondary libraries in the main project
  • Caution
  • Including a secondary library in a project
  • Using external libraries by programming
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
Warning
From version 18, , the use of several libraries is not recommended. We advise you to replace the secondary libraries by internal or external components.
Overview
A library is a WDL file that contains all the resources: windows, reports, classes, sets of procedures, ... This file is used by the executable or by the WEBDEV engine (for a dynamic site).
To optimize the loading of a large project in the editor (project containing hundreds of window for example), we advise you to divide this project.
To divide a large project, you can:
  • use independent projects: each project generates an independent executable. These executables interact between themselves. The main inconvenient of this method is as follows: these executables do not share their resources.
  • use secondary libraries:
    • A main project is used to generate the main library and the executable.
    • Some secondary projects ("Library" type) are used to generate the secondary libraries used by the main project. At run time, the program opens the main library and the secondary libraries: all the resources are shared among the different libraries.
How to create the different types of libraries?

Creating the main library

The main library of an application is created:
  • when creating the executable (in WINDEV and WINDEV Mobile).
  • when creating the setup program (in WEBDEV).
All the components found in the current project are automatically included in this library. Some elements can be added or deleted during the creation of the library.
For more details, see:

Creating the secondary projects and the secondary libraries

To create the secondary projects:
  1. In the editor, create a new project of "Library" type.
    • Select "File .. New .. Project".Click among the quick access buttons. Click "Project" in the wheel that is displayed. The wizard for project creation starts.
    • In the "Description - Project type" screen, select "Library".
    • Follow the different steps of the wizard for project creation.
  2. Include all the elements required by the project:
    • share (if necessary) the analysis of the main project,
    • if you have an existing one, import the windows and the reports managed by the secondary project,
    • create the elements managed by the secondary project.
  3. Versions 16 and later
    Configure the options of the library: In the project explorer:
    • select the project configuration corresponding to your library.
    • select "Description" from the popup menu.
    • In the "Compatibility" tab, select the compatibility options of the library:
      • Use in the WINDEV projects only or not,
      • Activation of the 64-bit compilation errors,
      • Activation of the Linux compilation errors.
      • Validate.
    New in version 16
    Configure the options of the library: In the project explorer:
    • select the project configuration corresponding to your library.
    • select "Description" from the popup menu.
    • In the "Compatibility" tab, select the compatibility options of the library:
      • Use in the WINDEV projects only or not,
      • Activation of the 64-bit compilation errors,
      • Activation of the Linux compilation errors.
      • Validate.
    Configure the options of the library: In the project explorer:
    • select the project configuration corresponding to your library.
    • select "Description" from the popup menu.
    • In the "Compatibility" tab, select the compatibility options of the library:
      • Use in the WINDEV projects only or not,
      • Activation of the 64-bit compilation errors,
      • Activation of the Linux compilation errors.
      • Validate.
  4. Create the library ("Workshop .. Library .. Generate the library"). The wizard for library creation starts. Create the library:

    The wizard for library creation starts.
  5. Select the elements that will be included in the library. The library and the current project will have the same name. You can:
    • Add elements ("Add" button):
      Any type of file can be added to the list of elements inserted into the library: images, text files, ...
    • Delete elements ("Remove" button)
      The corresponding files and their dependencies will be ignored in the library.
    • Create the library from an existing library description ("WDU" button).
      When creating a WINDEV or WINDEV Mobile library, a ".WDU" file of the same name is automatically created. This file contains all the references of the elements included in the library. All you have to do is select the WDU file containing the elements to take into account.
      IMPORTANT: Click the "Advanced" button and check "Yes: the library can be included in other projects".
  6. Specify the languages found in the library. You can use:
    • one or more languages associated with the project
    • all the project languages
    • the current language only
  7. If your library contains classes, you have the ability to configure for each class:
    • whether the class is visible: The class can be used in another project like any other project class: you will have the ability to declare an object of the class or to derive this class for example.
    • whether the class is hidden: The class cannot be used in another project.
  8. Specify the information about the library version:
    • the name of the company. For example, the name of the publisher.
    • a short description. For example: "Inventory management".
    • the copyright
    • the version of the library. All the characters (digits and letters) are allowed. For example: "1.01A".
      We advise you to:
      • use a different version number whenever the library is created.
      • automatically increment the last characters (digit or letter) of the version number whenever the library is created (check "Automatically increment the version at each creation").
        For example:
        - the version number "1.01A" will become "1.01B".
        - the version number "A15Z" will become "A16A".
  9. Specify whether the updates by Patch must be taken into account by the library. In this case, all you have to do is copy the file corresponding to the Patch into the directory of the library. See Application patch for more details.
  10. Validate the library creation (and the project backup if necessary).
Including secondary libraries in the main project

Caution

To include a secondary library in a main library, the option "Yes: the library can be included in other projects" must have been chosen during the library creation.

Including a secondary library in a project

To include a secondary library in a project:
  1. Select "Workshop .. Library .. External libraries".
  2. Add the secondary libraries that must be included in the project.
  3. Validate.
Only the classes defined as visible in the secondary library can be handled in the project. You will have the ability to declare an object of this class or to derive this class. The class is recognized in the project. The automatic completion (if it is enabled) will propose this class. No error will occur when the project is compiled.
The classes included in a secondary library can open the windows found in the secondary library for example.
WINDEVWindows Mobile When creating the executable of the main application, the secondary library is automatically selected and copied into the directory of the executable. This library will be automatically loaded when running the executable.
Using external libraries by programming
When running the executable, the main library of the project is automatically loaded. If the secondary libraries have not been included in the project, you must use:
  • LoadWDL to load a secondary library in the project. The elements found in the secondary library can be handled by programming (windows, reports, classes, ...).
  • UnloadWDL to unload a secondary library.
If a library is closed by UnloadWDL, the HyperFileSQL data files opened in the WDL are not automatically closed.
Any access to the HyperFileSQL data files will trigger the following error: "The XXX WDL was unloaded". We recommend that you use HClose on the data files opened in a WDL that is going to be unloaded.
Note: In this case, the secondary library must be found in the directory of the executable and it must be included in the list of files to install when deploying the application.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment