<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Thanks Graeme,Its like what I do so it seems Im doing OK.<br></div>
<div>I looked at the code and it seems it just remove { and }.<br></div>
<blockquote><div><div>  if (LValue[1] = '{') and</div>
<div>    (LValue[cGUIDLength] = '}') then</div>
<div>    LValue := Copy(lValue, 2, cGUIDLength - 2);</div>
<div>  AAssignTo.AsString := LValue;</div>
</div>
</blockquote><div> </div>
<div>It seems it doesnt remove "-" .<br></div>
<div> </div>
<blockquote><div><span class="highlight" style="background-color: rgb(255, 255, 255)"><span class="colour" style="color:rgb(31, 31, 31)">This may be an appropriate use for EnterCriticalSection and ExitCriticalSection, although why don't you just use a different "prefix" in the call to GetTempFile for each thread.</span></span><br></div>
</blockquote><div> </div>
<div>Yes I can but GUID is easier to use.<br></div>
<blockquote><pre class="u-article">I wasn't aware that GetTempFileName isn't threadsafe.
(Are you sure your code is correct?)<br></pre></blockquote><div id="sig12586409"><div class="signature">Yea.<br></div>
<div class="signature">If you look at the implementation it just check until there isnt a file so if 2 thread get a filename before they create it it cause a problem.<br></div>
<div class="signature">In my case I made 100 thread and they will create temp file and use them,simple but some time it will happen.<br></div>
<div class="signature"> </div>
</div>
<blockquote><div id="sig12586409"><div class="signature"><pre class="u-article" style="color: rgb(31, 31, 31); font-stretch: inherit; font-family: inherit; white-space: pre-wrap; word-wrap: break-word; position: relative;">var
   GUID : TGUID;
begin
   if CreateGUID(GUID) = 0 then
   begin
     MyFileName := GuiDToString(Guid);
   end;<br></pre></div>
</div>
</blockquote><div id="sig12586409"><div class="signature"> </div>
<div class="signature">Thanks.<br></div>
<div class="signature"> </div>
<div class="signature">Regards,<br></div>
<div class="signature">Ara<br></div>
</div>
<div> </div>
<div> </div>
<pre>
-- 
http://www.fastmail.com - mmm... Fastmail...
</pre>
</body>
</html>