I am attempting to get the username of the current user on a windows computer using windows API. I am using the GetUserName function in the Windows Unit. I am having some problems with giving the correct data types for function arguments. Any help would be greatly appreciated.
program logname;
uses
Windows;
var
username : array[0..255] of char;
begin
if GetUserName(username,255) then
begin
WriteLn(username);
end;
Readln;
end.
When I run the compiled program I get a runtime error of 216 at 0x77FE1DDE.
I also get an error from my ide that the compiler does not know which function to overload.
I am using FPC and the FPS ide.
Thanks.
--EAnder