﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <description><![CDATA[Comments for How to display the current user name.]]></description>
    <title><![CDATA[Comments for How to display the current user name.]]></title>
    <link>http://dn.codegear.com/article/26731</link>
    <!-- source: http://dn.codegear.com/article/26731/feed-->
    <dc:date>2008-11-19T05:33:38-08:00</dc:date>
    <item>
      <description><![CDATA[Happend here too... I solved the problem like this:added the following line in the Procedure declarations section:function CurrentUserName: String;then added the function like this:function TForm1.CurrentUserName:String;var  u: array[0..127] of Char;  sz:DWord;begin  sz:=SizeOf(u);  GetUserName(u,sz);  Result:=u;end;Now you can call it anytime using Form1.CurrentUserName and it acts as a String.]]></description>
      <title><![CDATA[re: How to display the current user name.]]></title>
      <managingEditor>
	 (Arthur van Dijk)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=39920</guid>
      <dc:date>2007-02-27T09:34:49-08:00</dc:date>
      <pubDate>2007-02-27T09:34:49-08:00</pubDate>
      <source url="http://dn.codegear.com/article/26731/feed">Comments for How to display the current user name.</source>
    </item>
    <item>
      <description><![CDATA[I have found that there is a high failure rate on GetUserName (50%) if you do not call it like this:procedure TfrmMain.FormCreate(Sender: TObject);var UserName : PChar; c : Cardinal;begin//Get User Name Windows API call c := 0; GetUserName(nil, c); UserName := StrAlloc(c); if GetUserName(UserName, c) then  UserRec.Login := Uppercase(StrPas(UserName)); StrDispose(UserName);//NT GetUserName Windows API call//Other stuff goes here end;]]></description>
      <title><![CDATA[How to display the current user name.]]></title>
      <managingEditor>
	 (Ben Hull)
</managingEditor>
      <guid isPermaLink="true">http://threads.codegear.com/threads/threads.exe/view?commentid=27931</guid>
      <dc:date>2001-02-12T06:45:00-08:00</dc:date>
      <pubDate>2001-02-12T06:45:00-08:00</pubDate>
      <source url="http://dn.codegear.com/article/26731/feed">Comments for How to display the current user name.</source>
    </item>
    <generator>Atom 1.0 XSLT Transform v1 (http://atom.geekhood.net)</generator>
  </channel>
</rss>