Can somebody, write a simple code on how to get user name using this
function GetUserName it must include windows.h , I try it to understand, but
didn't find good explanation on the internet.
Are you trying to get the user name in wide characters? If so, you should change the type of name to wchar_t (wchar_t name[UNLEN+1];) and then, while calling the function cast it to LPWSTR: GetUserNameW( (LPWSTR)name, &size )
I just copy/paste your code , and get that error. -----------------------------------------------------It work when I compile it in DEV++ , but dont work in visual studio 2005Any sugestion,
-----------------------------------------------------
Can this be fixed.