DllFunction.NextArgPairIsUnicodeString

Prototypes

void NextArgPairIsUnicodeString( int nMaxLenBuffer, StringBuffer sb )

void NextArgPairIsUnicodeString( StringBuffer sb, int nMaxLenBuffer )

Parameters

int nMaxLenBuffer
The maximum number of Unicode characters the DLL function may copy to the buffer.

StringBuffer sb
On entry, contains the Unicode character string to be converted to a null-terminated Unicode character string and then copied to the read-write buffer passed to the DLL function. On return, contains the Unicode character string constructed from the null-terminated Unicode character string copied to the read-write buffer by the DLL function.

Remarks

This method declares the function's next two parameters to be an integer buffer length and a read-write buffer containing a null-terminated Unicode character string. The C language types of these parameters must be either "int, wchar_t*" (or equivalent) or "wchar_t*, int" (or equivalent). Call the method with the parameters listed in the order required by the DLL function.

The method constructs a null-terminated Unicode character string from the StringBuffer parameter. The DLL function may modify the Unicode character string passed to it as long as the length of the modified string does not exceed nMaxLenBuffer characters in length (including the final null character).

Example
declare DllFunction func = new DllFunction();
func.Init( "kernel32.dll", "GetCurrentDirectoryW", 2 );
declare StringBuffer sb = new StringBuffer();
func.NextArgPairIsUnicodeString( 260, sb );
func.Call_Void();
declare String s = sb.toString();
print s;
See Also

DllFunction.NextArgPairIsAnsiString
DllFunction.NextArgIsConstUnicodeString