title: Get Username and Domain in C++
body: <p>Been looking around a little bit and I have found some code to do this but it did not work...maybe my google skills aren't great but my question is....</p>
  
  <p>Can anyone point me in the right direction of how to retrieve the logged on users username and the domain that they are a part of in C++. I am expanding upon a windows forms application. I am working in Visual Studio 2008</p>
  
  <p>Link or code are welcome.</p>
  
  <p>Thank you </p>
  
  <p>[EDIT] I am looking for something like this 
  <a href="http://www.ehow.com/how_5169653_user-address-microsoft-visual-sharp.html" rel="nofollow">http://www.ehow.com/how_5169653_user-address-microsoft-visual-sharp.html</a></p>