GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Sep-2008, 23:40
ngjackie ngjackie is offline
New Member
 
Join Date: Nov 2007
Posts: 20
ngjackie is on a distinguished road

Access user profile directory


I'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  
Old 16-Sep-2008, 06:56
dlp dlp is offline
Member
 
Join Date: May 2006
Posts: 157
dlp has a spectacular aura about

Re: Access user profile directory


You 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  
Old 16-Sep-2008, 21:39
dlp dlp is offline
Member
 
Join Date: May 2006
Posts: 157
dlp has a spectacular aura about

Re: Access user profile directory


Quote:
Originally Posted by dlp

Er, I should say Unmanaged C++ method.
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 13:15.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.