Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Sets the string to the value of the specified environment variable.
BOOL GetEnvironmentVariable(
PCXSTR pszVar
);
Parameters
- pszVar
Pointer to a null-terminated string that specifies the environment variable.
Return Value
Nonzero if successful; otherwise 0.
Remarks
Retrieves the value of the specified variable from the environment block of the calling process. The value is in the form of a null-terminated string of characters.
Example
// typedef CStringT<TCHAR, StrTraitATL<TCHAR, ChTraitsCRT<TCHAR>>> CAtlString;
CAtlString EnvStr;
EnvStr.GetEnvironmentVariable(_T("TEMP"));
_tprintf_s(_T("Current value of TEMP variable: %s\n"), EnvStr);
Requirements
Header: cstringt.h