I'm intrigued as to why the GetComputerName function is within a "FormCreate" method? Try ... (Place a Button on the Form, double click on it and type "ShowMessage (GetComputerName)" inside. Also what do the Labels do??) unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} function GetComputerName; string; var buffer: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char; Size: Cardinal; begin Size := MAX_COMPUTERNAME_LENGTH + 1; Windows.GetComputerName(@buffer, Size); Result := StrPas(buffer); end; procedure Button1Click(Sender:TObject); begin ShowMessage (GetComputerName) end; end.