|
-
September 10th, 1999, 03:36 AM
#1
GetUserName
How can I use in MFC programming GetUserName method which is win32 command. I don't have had any luck getting username into CString.
-Teemu
-
September 10th, 1999, 05:21 AM
#2
Re: GetUserName
Hi Teemu,
I just finish headache implementing this **** thing. GetUserName accept two parameters.Following Code will work for you:
char userName[256];
DWORD nameLength;
.........
nameLength = sizeof(userName);
if (GetUserName(userName, nameLength) != 0) {
// You have user name in buffer userName, Now you can move this value in CString variable.
Good luck.
--Sumit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|