Board index » cppbuilder » Error while using getenv()
Umut Ozden
![]() CBuilder Developer |
Error while using getenv()2003-11-29 06:30:21 PM cppbuilder57 My program creates a folder in the folder Documents and Settings\user01\Application Data I'm getting the name of the user by calling the function getenv(). AnsiString userPath; userPath = AnsiString(getenv("USERPROFILE")); CreateDir(userPath + "\\Application Data\\Folder1"); If the value of the environment variable USERPROFILE contains a character with a ascii value between 128 and 255, getenv() replaces this character with another character and CreateDir() function doesn't work because there is no such folder. Maybe, is there a better method than using getenv()? Thanks... |