Internationalization and localization tools


Process Control Function

int _spawnlp(int mode, const char *cmdname, const char *arg0, const char *arg1, ... const char *argn, NULL);

int _wspawnlp(int mode, const wchar_t *cmdname, const wchar_t *arg0, const wchar_t *arg1, ... const wchar_t *argn, NULL);

int _tspawnlp(int mode, const TCHAR *cmdname, const TCHAR *arg0, const TCHAR *arg1, ... const TCHAR *argn, NULL);

Internationalization (I18n) Function Overview

The _spawnlp function creates and executes a new process for the file cmdname, using the PATH environment variable to find the file, and called with a variable list of pointers to command-line arguments ending with a NULL pointer. The function returns -1 in the event of an error, or a value that depends on the setting of mode.

_wspawnlp is the wide-character version of _spawnlp that supports wide-character string arguments.

_tspawnlp is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _spawnlp or _wspawnlp.

See the MSDN library for more information.

I18n Issues

Use the appropriate version of the function as required for internationalization support, noting the following:

For a Windows MBCS application, _spawnlp depends on the multibyte code page in effect. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. Use _getmbcp and _setmbcp to query or change the current multibyte code page, respectively.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Process Control Functions

 

Lingoport internationalization and localization services and software