Board index » cppbuilder » get temporary directory

get temporary directory

hi,

how can i get the temporary directory of windows?

thanks,
    gunter

 

Re:get temporary directory


Quote
"Gunter Gemmel" <i...@gungem.de> wrote in message

news:3e1387da$1@newsgroups.borland.com...

Quote
> how can i get the temporary directory of windows?

Maybe this is what you are looking for?

  char  buffer[MAX_PATH];
  ::GetTempPath(MAX_PATH, buffer);

For my VCL projects I put this in a function that returns a string (along
with some error checking as well.)  Lookup GetTempPath in the Win32 API help
for more information.

HTH,
- Clayton

Re:get temporary directory


Try this:

    char b[MAX_PATH+1] = {0};
    GetTempPath(MAX_PATH, b);
    AnsiString TempDir = b;

Quote
"Gunter Gemmel" <i...@gungem.de> wrote in message

news:3e1387da$1@newsgroups.borland.com...
Quote
> hi,

> how can i get the temporary directory of windows?

> thanks,
>     gunter

Other Threads