PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Including the component in the project
  • Including the component in a project
  • Files automatically copied when the component is included in a project
  • Handling the component elements by programming
  • Note: the technical documentation of the component
  • Name conflicts
  • Using a component procedure in dynamic compilation
  • Classes and components
  • Updating a component
  • Creating the executable
  • Deploying an application that is using a component
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
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. Select "Workshop .. External component .. Import a component into the project". A file picker is opened.On the "Project" pane, in the "Project" group, expand "Import" and select "An external component .. From a file". A file picker is opened.
  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.
      See Distributing a component for more details.
  4. Validate. The description window of the selected component is displayed. This window presents:
    • 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 different component elements that can be accessed and used are displayed in:
    • The project graph. These elements are bordered by a green line.
    • 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 <ComponentName>.WDI file is copied into the project directory.
  • The <ComponentName>.WDK file is copied into the EXE sub-directory of the project.
  • If some files have been specified in the optional file (<ComponentName>.WDO), these files are copied into the EXE directory of the project (by respecting the tree structure specified in the WDO file.
Handling the component elements by programming
The visible elements of a component included in a project can be handled by programming only.
To handle a component element (window,...) by programming, handle the element like any other element created in the project.
  1. See the documentation of the element.
    To do so, perform one of the following operations:
    • double-click the element from the "Project explorer" pane or from the project graph
    • press [F2] from the element code.
  2. The documentation of the element 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(ComponentWindow [, Param1, Param2])
    • To print a report, use iPrintReport and pass (if necessary) the parameters expected by this report.
      iPrintReport(ComponentReport [, Param1, Param2])
    • To call a procedure, use the usual syntax.
      ComponentProcedure(Param1,Param2)
    • To use a class, declare a variable of the class type.
      MyVariable is object ComponentClass

      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(MyComponent.MyWindow)
To use the name of the element in a variable, you must specify the name of the component. For example:
sWindow is string = "MyComponent.MyWindow"
Open(sWindow)
No specific WLanguage function is required to handle the component.

Note: the technical documentation of the component

The technical documentation of component is available:
  • when a component is included in a project ("Workshop .. External component .. Import a component into the project").when a component is included in a project: on the "Project" pane, in the "Project" group, expand "Import" and select "An external component .. From a file".
  • in the description of the components included in the project ("Workshop .. Component .. List of components included in the project"). The [Description] button is used to get information and documentation about the component.in the description of the components included in the project:
    • In the project explorer, select the "External components" folder.
    • Display the popup menu and select "List of external components imported into the project".
    • The [Description] button is used to get information and documentation about the component.
  • at any time via a double click on the component icon found in the "Wizards, Examples and Components" pane or via "Description" from the popup menu of component. The description window of component can be left opened while you are working on your project.

Name conflicts

Caution: if a project element and a component element have the same name, the component element must be prefixed by 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):
ComponentName.SetName.ProcedureName()
Note: You also have the ability to use Execute:
Exécute("ComponentName.SetName.ProcedureName")

Classes and components

A component can contain classes in its interface. You have the ability to derive these classes in the host project, to overload the virtual methods, to provide 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 setup directory of the component (according to the setup mode used). See Distributing a component for more details.
  • 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: You can force the update of a component from the list of components found in the project ("Workshop .. Component .. List of components imported into the project", "Update" button).Note: You can force the update of a component from the list of components found in the project:
    • In the project explorer, select the "External components" folder.
    • Display the popup 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. See Deploying an application that is using a component for more details.
Creating the executable
WINDEVWINDEV MobileWindowsWindows Mobile The method for creating the executable that is using the component is the same as the method for creating the executable for a WINDEV application. The DLLs required for the component to operate are automatically detected.
Deploying an application that is using a component
The method for deploying an application that uses one or more components is the same as the method for deploying a standard application.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment