Passing Complex Structures To A .Dll: An Example - Symantec WISESCRIPT EDITOR 8.0 - REFERENCE FOR WISE PACKAGE STUDIO V1.0 Reference

Table of Contents

Advertisement

Passing Complex Structures to a .DLL: An Example

WiseScript Editor Reference
and select Contained within structure for all subsequent elements of the
structure. You do not pass the structure name, just the elements inside it.
See
Passing Complex Structures to a .DLL: An Example
Value Source
Select the type of value to be passed: Variable (pass by reference), constant (pass
by value), constant with null value, or constant with window handle (pointing to the
installation window).
Variable Name
If Value Source is set to Variable, select or enter a variable.
Constant Value
If Value Source is set to Constant, enter a constant here. You can enter a variable
here (example: %NUMUSERS%).
You can use a Call DLL Function to call a .DLL. In addition to passing simple parameters,
such as integers and strings, to a .DLL, you can also pass complex structures
(sometimes called records in Pascal or Visual Basic). For each parameter, you select a
passing type. For non-structure parameters, select Normal from Passing Type in the
DLL Parameter Settings dialog box. However, for structure elements (also referred to as
members), select First element of structure for the first item in the structure, or
Contained within structure for subsequent items. A structure ends if there are no
more parameters, or if the next parameter is set to Normal or First element of a
structure.
Note
The following code samples are in the C programming language.
Suppose that you have a function in a .DLL that processes information for a new
employee. The return value of the function is a simple integer indicating success or
failure. The function accepts three parameters: a structure that contains three
elements, an integer, and another structure that contains two elements. The calling
statement for the .DLL is:
int NewEmployee (EMPLOYEE*, int, DEPARTMENT*);
where EMPLOYEE* is a pointer to a structure, int is a simple integer, and DEPARTMENT*
is a pointer to a structure.
In this example, the layout of the EMPLOYEE structure is as follows:
typedef structure EMPLOYEE {
LPSTR name;
LONG salary;
CHAR title[50];
}
The layout of the DEPARTMENT structure is as follows:
typedef structure DEPARTMENT {
LPSTR deptname;
LPSTR deptnum;
WiseScript Actions
on page 49
49

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Wisescript editor 8.0

Table of Contents