Windows API Help File (D3)

GetTempDrive  Overview  Group

The GetTempDrive function is not implemented in the Win32 API. Win32-based
applications should use the GetTempPath function.


In lieu of any function to explicitly extract the drive letter, you could
cast the result of GetTempPath to a string and use ExtractFileDrive on it.
Then cast the result back to a Pchar and pass it in your gettempfilename
call ( I haven't got time to read your code which is a little hard to
decipher at first because it is too tightly packed, so there may be a
simpler way)

============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Darren J Gilbertson
> Sent: Thursday, 19 August 1999 16:34
> To: Multiple recipients of list database
> Subject: [DUG-DB]: creating at temp filename
>
>
> I am creating a temporary filename using:
>
> function gettemporaryfilename:string;
> const
>   MAX_PATH=144;
> var
>   lppathbuffer:pchar;
>   lpbuffer:pchar;
> begin;
>   getmem(lpbuffer, MAX_PATH);
>   getmem(lppathbuffer,MAX_PATH);
>   gettemppath(MAX_PATH,lppathbuffer);
>   gettempfilename(lppathbuffer,'tmp',0,lpbuffer);
>   freemem(lppathbuffer,MAX_PATH);
>   gettempfilename(gettempdrive('C'),0,lpbuffer);
>   result:=strpas(lpbuffer);
>   freemem(lpbuffer,MAX_PATH);
> end;
>
> but the gettempdrive part does not work
>
> any suggestions
>
>
> Darren
> ------------------------------------------------------------------
> ---------
>   New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to