DLL.New method creates a new variable of the specified type and returns this variable.
|Count||[in]||Optional||Integer||Default value: 1|
|Result||Object of the specified type|
The method is applied to the following object:
The method has the following parameters:
The name of the type. Before using it in
DLL.New, the name of the type must be registered in TestComplete by the
There are two predefined TypeNames:
LPWSTR. They are used to create strings to be passed to functions. For more information, see Calling DLL Functions From Tests - Tutorial.
The number of the elements to be created. By default, it is 1, which means that you are creating one instance of the specified type. If Count is greater than 1, it means that you are creating an array of elements of the specified type.
For a variable of the
LPWSTR type, the Count parameter specifies the maximum number of characters that can be contained in the string to be created.
A variable of the specified type.
New method fills the memory allocated for the variable with zeros. So, if you create an
LPWSTR variable, it will refer to a null string. If you create a structure, the structure will be filled with zeros.
To view an example that demonstrates how to use the
New method, see Using Arrays in DLL Function Calls.