windows_programming_notes.nbk: Home | Index | Next Page: CommDlgExtendedError | Previous Page: COM in plain C Series


 CommandLineToArgvW

The CommandLineToArgvW function parses a Unicode command-line string. It returns a pointer to a set of Unicode argument strings and a count of arguments, similar to the standard C run-time argv and argc values. The function provides a way to obtain a Unicode set of argv and argc values from a Unicode command-line string.

Syntax

    LPWSTR * CommandLineToArgvW(
      LPCWSTR lpCmdLine,  // pointer to a command-line string
      int *pNumArgs       // receives the argument count
    );

Parameters

Return Values

If the function succeeds, the return value is a non-NULL pointer to the constructed argument list, which is an array of Unicode strings.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

It is the caller's responsibility to free the memory used by the argument list when it is no longer needed. To free the memory, use a single call to the GlobalFree function.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: CommDlgExtendedError | Previous Page: COM in plain C Series


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time