![]() |
|
#1
|
|||
|
|||
Access user profile directoryI'm writing a CLR application with Microsoft Visual C++. I'm trying to get the program to access user profile directory in order to write a file into My Documents folder of the current user. But, how can I access the user profile directory under Windows? I tried %userprofile% in the path but it didn't work. Please show me with some code examples. By the way, does anyone know how we can make the program minimize/ hide to the system background? So it does its job quietly and won't disturb the users. Thanks in advance.
|
|||
|
#2
|
|||
|
|||
Re: Access user profile directoryYou need to expand the environment variable, then form the string.
.NET method: http://msdn.microsoft.com/en-us/library/77zkk0b6.aspx C++ method: http://msdn.microsoft.com/en-us/library/ms683188.aspx |
|
#3
|
|||
|
|||
Re: Access user profile directoryQuote:
Er, I should say Unmanaged C++ method. |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ Candy machine simulation (m0g0l) | cplus2x | C++ Forum | 1 | 07-Feb-2008 05:21 |
| Named virtual host not working | Johnnyrotton | Apache Web Server Forum | 4 | 04-Sep-2007 20:32 |
| how to access User defined functions of my View class to MainFrm class? | prabhakar157 | MS Visual C++ / MFC Forum | 1 | 17-May-2006 03:09 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 06:19 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 02:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The