Navigation:  Click-Script Guide > DLL Actions >

Defining Parameters

Previous pageReturn to chapter overviewNext page

The DLL Action's formal parameters must to be the same parameters of the DLL function. You must do a directory conversion from the function's definition and the DLL Action's definition.

 

First you must define the number of DLL function's parameters, changing the ParamsCount property.
Then you must define each property of each parameter:

 

Name

The name of the parameter. This name must to be unique.

Description

The description of the parameter, that will be displayed in the click-script's editor.

Type

The type of the parameter, this type must to be equivalent to the type of the DLL function's parameter.

Variable

Defines if the parameter can be changed and returned to the caller event. If you select true for this property, VisualSetup will define this parameter as a pointer of the Type type.

 

Example: defining a DLL action to call the Unicode version of the message box function of Windows API

Name = MessageBoxW

Description = Calls the Unicode version of the message box function of Windows API

Type = LongInt

Unicode = True

FileName = %SysDir%\user32.dll

FunctionName = MessageBoxW

ParamsCount = 4

 

[Parameter 1]

Name = Handle

Description = Handle of the owner window

Type = LongInt

Variable = False

 

[Parameter 2]

Name = Message

Description = Text in the message box

Type = String

Variable = False

 

[Parameter 3]

Name = Title

Description = Message box title

Type = String

Variable = False

 

[Parameter 4]

Name = Type

Description = Message box style

Type = LongInt

Variable = False

 

 

Main Type Conversions

 

You must to convert the type DLL function's parameters to a compatible type of DLL Action's parameter.

 

C / C++ Type

Pascal / Delphi Type

VisualSetup Type

TCHAR*, LPTSTR

-

String

char*, LPSTR

String

String (Unicode = False)

wchar_t*, LPWSTR

WideString

String (Unicode = True)

TCHAR

-

Char

char

Char

Char (Unicode = False)

wchar_t

WideChar

Char (Unicode = True)

DWORD, long int

DWORD, LongInt

LongInt

WORD, int

WORD, Integer

Int

BOOL

BOOL, LongBool

Boolean