Specifies the access path to an external component of project. This external component is not loaded.
Remark: The mode for loading the external component (when starting the project or when using an element of the external component for the first time) is defined when the external component is included in the project.
// Access path to the component
ResPath is int
ResPath = ComponentLocate(MyComponent, "C:\MyComponents")
Error("The specified component cannot be found in the specified directory")
CASE cisVersionTooOld, cisVersionTooRecent:
Error("The version of the component is not compatible with the executable")
Info("The specified component is already loaded")
Info("The specified component is available")
<Result> = ComponentLocate(<Component name> , <Access path to component>)
<Result>: Integer constant
Status report of operation:
|cisAbsent||The external component is not found in the specified path.|
|cisLoaded||The external component is already loaded. ComponentLocate has no effect.|
|cisReady||The external component is available and usable.|
|cisVersionTooOld||The version of external component is too old. It is not compatible with the current executable.|
|cisVersionTooRecent||The version of external component is too recent. It is not compatible with the current executable.|
<Component name>: Character string
Name of external component (displayed in the editor) whose access path must be specified. A WLanguage error occurs if the name of external component is unknown.
<Access path to component>: Character string
Directory of external component (WDK file). This directory may (or may not) end with a "\". A full path, a relative path or a UNC path can be used.
Loading an external component
The load mode of the external component (when starting the project or during the first use of a component element) is defined when the external component is included in the project.
To change the loading mode:
- In the "Project explorer" pane:
- select the "External components" folder.
- right-click to open the folder context menu
- select "List of external components imported into the project".
- In the window that appears, select the desired external component and click "Description".
- Modify the load mode ("Load mode of component").
Reminder: The following events are executed when an external component is loaded:
- declaration event of the classes of the component.
- declaration event of the sets of procedures of the component.
- initialization event of the component.
Finding the external component to load
When loading the external component, the external component will be sought:
- first, in the directory specified in the <Component directory> of ComponentLoad.
- then, in the directory specified in <Component directory> of ComponentLocate.
- then, in the directory specified in "<Component name>.INI". For more details on this file, see Deploying an application that uses an external component.
- finally, in the EXE directory of the project.