DllFunction.NextArgIsConstAnsiString

Prototypes

void NextArgIsConstAnsiString( <String sText> )

Parameters

String sText
The string to assign to the function parameter. If you call this method without specifying sText, you are specifying the type of the function's parameter without specifying its value. You can specify the value later by calling the method SetConstAnsiStringArg.

Remarks

This method declares the type of the function's next parameter to be a read-only null-terminated ANSI character string. The DLL function should use the C type "const char *" (or equivalent) for this parameter.

If you call this method with a String parameter, the method constructs a null-terminated ANSI character string from the String parameter. The DLL function must not modify the ANSI character string passed to it. If you want to receive an ANSI character string back from a DLL function, you must use the method NextArgPairIsAnsiString.

Example
declare DllFunction func = new DllFunction();
func.Init( "USER32", "MessageBoxA", 4 );
declare long lHandle = 0;
func.NextArgIsWindowsHandle( lHandle );
func.NextArgIsConstAnsiString( "Do you want to continue?" );
func.NextArgIsConstAnsiString( "MessageBox Test" );
/* MB_TOPMOST = 262144, MB_ICONQUESTION = 32, MB_YESNO = 4 */
func.NextArgIsInt32( 262144 + 32 + 4 );
declare int nResponse;
nResponse = func.Call_Int32();
if nResponse = 6 then /* IDYES = 6 */
    print "YES";
else
    print "NO";
See Also

DllFunction.SetConstAnsiStringArg
DllFunction.NextArgPairIsAnsiString