ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Component / External component
  • Overview
  • Including the component in the project
  • Including the component in a project
  • Files automatically copied when the component is included in a project
  • Manipulate component elements programmatically
  • Note: the technical documentation for the
  • Name conflicts
  • Using a component procedure in dynamic compilation
  • Classes and components
  • Updating a component
  • Creating the executable
  • Deploying an application that uses a component
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Including the component in the project

Including the component in a project

To include a component in a project:
  1. Open the project in WINDEV, WEBDEV or WINDEV Mobile.
  2. On the "Project" tab, in the "Project" group, expand "Import" and select "An External component .. From a file". A file picker appears.
  3. Select the WDI file of the component to import. Depending on the selected distribution mode, this file can be found:
    • in the creation directory of the component if the computer where the component is created and the computer where the component is used are identical,
    • in the directory where the component files have been made available,
    • in the directory where the setup procedure of the component has copied the component files.
      For more details, see Distributing a component.
  4. Validate. The description window of the selected component appears. This window shows:
    • the component description (company, version, ...).
      You have the ability to choose the load mode of the component (when starting the project or when using a component element for the first time). By default, the component is loaded when a component element is used for the first time.
    • the component documentation. This documentation explains how to use the different elements of the component.
  5. Validate. The accessible and usable component elements are displayed in the "Project explorer" pane. A specific icon indicates that the element comes from a component.

Files automatically copied when the component is included in a project

When a component is included in the project, all the files required by the component are automatically copied into the project directory:
  • The <Component name>.WDI file is copied into the project directory.
  • The <Component name>.WDK file is copied to the EXE subdirectory of the project.
  • If there are files in the <Component name>.WDO optional file, they are copied to the project's EXE directory (following the tree structure specified in the WDO file).
Manipulate component elements programmatically
The visible elements of a component included in a project can be handled through programming only.
To handle a component element (window, etc.) through programming, handle the element like any other element created in the project.
  1. See the documentation about the element.
    To do so, perform one of the following operations:
    • double-click the element from the "Project explorer" pane.
    • press F2 from the element code.
  2. The element documentation is displayed in the code editor. This documentation presents the parameters required for using the element (input/output parameters, ...).
  3. Use the element according to the information specified in the documentation as if this element belonged to the project.
    • To open a window, use Open and pass (if necessary) the parameters expected by this window.
      Open(FenêtreDuComposant [, Param1, Param2])
    • To print a report, use iPrintReport and pass (if necessary) the parameters expected by this report.
      iPrintReport(EtatComposant [, Param1, Param2])
    • To call a procedure, use the usual syntax.
      ProcédureDuComposant(Param1,Param2)
    • To use a class, declare a variable of the class type.
      MaVariable is object ClasseDuComposant

      The variable is then used like any object variable.
If a conflict occurs with a project element, the element name must be prefixed by the component name. For example:
Open(MonComposant.MaFenêtre)
To use the element name in a variable, the component name must be specified. For example:
sWindow is string = "MyComponent.MyWindow"
Open(sWindow)
No specific WLanguage function is required to handle the component.

Note: the technical documentation for the

The technical documentation of component is available:
  • when integrating a component into a project: under the "Project" pane, in the "Project" group, pull down "Import" and select "An external component . From a file".
  • in the description of the components included in the project:
    • In the "Project explorer" pane, select the "External components" folder.
    • Open the context menu and select "List of external components imported into the project".
    • The [Description] button is used to get information and documentation about the component.

Name conflicts

Attention: if a project element and a component element have the same name, to use the component element, you must prefix this element with the component name.
For example, the "Menu" window is available in the current project and in the "Email" component used by the project. The following syntax allows you to open the "Menu" window of the "Email" component:
Open("Email.Menu")

Using a component procedure in dynamic compilation

To use a component procedure in dynamic compilation:
  1. The component must necessarily be loaded. The component can be defined as "Loaded when the application is started" or it can be loaded by ComponentLoad.
  2. The full name must be used to identify the procedure and this name must be followed by brackets to indicate that a procedure must be used (instead of a global variable):
    NomComposant.NomCollection.NomProcédure()

    Note: You can also use the Execute function:
    Execute("NomComposant.NomCollection.NomProcédure")

Classes and components

A component can contain classes in its interface. You can derive these classes in the host project, override virtual methods and achieve polymorphism. The inheritance is available between several levels of components.
Updating a component
  • When a new version of a component is available, all you have to do is install the new files of this update in the installation directory of the component (according to the setup mode used). For more details on the different modes to install a component, see Distributing a component.
  • When opening a project that uses this component, the change of component version will be automatically detected and a project update will be proposed. We recommend that you recompile the project.
    Note: It is possible to force the update of a component from the list of components present in the project:
    • In the "Project explorer" pane, select the "External components" folder.
    • Open the context menu and select "List of external components imported into the project".
    • Click the "Update" button.
  • If the component was distributed with a WINDEV application, the component must be updated. For more details, see Deploying an application that uses a component.
WINDEV
Creating the executable
The executable (that uses the component) is created in the same way as a WINDEV application. The DLLs required for the component are automatically detected.
Deploying an application that uses a component
An application that uses one or more components is deployed in the same way as a standard application.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help