wxSetEnv for Win32 (doesn't really work)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -457,6 +457,24 @@ bool wxDirExists(const wxString& dir)
|
||||
#endif // Win32/16
|
||||
}
|
||||
|
||||
bool wxSetEnv(const wxString& var, const wxChar *value)
|
||||
{
|
||||
// some compilers have putenv() or _putenv() or _wputenv() but it's better
|
||||
// to always use Win32 function directly instead of dealing with them
|
||||
#if defined(__WIN32__)
|
||||
if ( !::SetEnvironmentVariable(var, value) )
|
||||
{
|
||||
wxLogLastError(_T("SetEnvironmentVariable"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
#else // no way to set env vars
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// process management
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user