Hi,
I'd like to know what is the handiest way to get the current directory of
the application?
Thank in advance

Re: How to get current directory? by David

David
Wed Feb 28 03:25:08 CST 2007

>I'd like to know what is the handiest way to get the current directory of
>the application?

Have you tried the GetCurrentDirectory API?

Dave

Re: How to get current directory? by Jacky

Jacky
Wed Feb 28 03:33:45 CST 2007


"David Lowndes" <DavidL@example.invalid>
???????:0iiau2dfp5a92couqpjq4f4b0n37kgu16f@4ax.com...
> >I'd like to know what is the handiest way to get the current directory of
>>the application?
>
> Have you tried the GetCurrentDirectory API?
Thanks

>
> Dave



Re: How to get current directory? by Jacky

Jacky
Wed Feb 28 03:38:30 CST 2007


"David Lowndes" <DavidL@example.invalid>
???????:0iiau2dfp5a92couqpjq4f4b0n37kgu16f@4ax.com...
> >I'd like to know what is the handiest way to get the current directory of
>>the application?
>
> Have you tried the GetCurrentDirectory API?

BTW, how can you know whether a file exists?
The MSDN is hard to search...

>
> Dave



Re: How to get current directory? by Jochen

Jochen
Wed Feb 28 04:31:38 CST 2007

Hi Jacky!

> BTW, how can you know whether a file exists?

CRT: _access("name", 0) != -1
WinAPI: GetFileAttributes("name") != INVALID_FILE_ATTRIBUTES

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Re: How to get current directory? by adebaene

adebaene
Wed Feb 28 10:22:36 CST 2007

On 28 f=E9v, 10:38, "Jacky" <j...@knight.com> wrote:
> "David Lowndes" <Dav...@example.invalid>
>
> BTW, how can you know whether a file exists?
> The MSDN is hard to search...

You are NOT interested to know wether a file exist or not, because the
file may exist, but the user account your soft is running on may not
have the rights to do anything on it.

What you are interested in is to know wehter you can do a particular
operation on the file (read, write, rename, etc...) : The best option
is simply to try to do this operation and check for an error.

Arnaud
MVP - VC