| View previous topic :: View next topic |
| Author |
Message |
Renan Guest
|
Posted: Thu Oct 26, 2006 9:52 pm Post subject: detect software directory |
|
|
How do I detect the directory of the software I'm running ( I want this software to detect its own directory)
How do I get system date?
Thanks |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Thu Oct 26, 2006 10:16 pm Post subject: Re: detect software directory |
|
|
| Quote: | How do I detect the directory of the software I'm running
|
GetCurrentDirectory
| Quote: | How do I get system date?
|
GetLocalTime
GetSystemTime
.. Ed
| Quote: | Renan wrote in message
news:4540e7c1$1 (AT) newsgroups (DOT) borland.com...
How do I detect the directory of the software I'm running ( I want
this software to detect its own directory)
How do I get system date? |
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Oct 26, 2006 11:52 pm Post subject: Re: detect software directory |
|
|
"Renan" <nospam_dot_gulbrrs (AT) gmail_dot_ (DOT) com> wrote in message
news:4540e7c1$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How do I detect the directory of the software I'm running
( I want this software to detect its own directory)
|
Call GetModuleFileName() and then strip off the filename portion.
Gambit |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Oct 26, 2006 11:53 pm Post subject: Re: detect software directory |
|
|
"Ed Mulroy" <dont_email_me (AT) bitbuc (DOT) ket> wrote in message
news:4540ed72$1 (AT) newsgroups (DOT) borland.com...
| Quote: | GetCurrentDirectory
|
Why would you recommend that? The current working directory for a process
is dynamic (and can even be specified when the process is first started).
It is not a very reliable way to get the folder that the application is
running in.
Gambit |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Fri Oct 27, 2006 12:16 am Post subject: Re: detect software directory |
|
|
| Quote: | Why would you recommend that?
|
Because I understood that to be what he was asking for.
As for it being dynamic, that is under program control and he is writing the
program.
.. Ed
| Quote: | Remy Lebeau wrote in message
news:4541047a$3 (AT) newsgroups (DOT) borland.com...
GetCurrentDirectory
Why would you recommend that? The current working directory
for a process is dynamic (and can even be specified when the
process is first started). It is not a very reliable way to get the
folder that the application is running in. |
|
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Fri Oct 27, 2006 12:21 am Post subject: Re: detect software directory |
|
|
Ed Mulroy wrote:
| Quote: | How do I detect the directory of the software I'm running
GetCurrentDirectory
|
GetModuleFileName might work more often, if he wants the directory of
the executable. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Oct 27, 2006 12:45 am Post subject: Re: detect software directory |
|
|
"Ed Mulroy" <dont_email_me (AT) bitbuc (DOT) ket> wrote in message
news:4541097a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | As for it being dynamic, that is under program control and
he is writing the program.
|
It may be under program controll, but there are plenty of VCL and Win32
controls that change the working directory at runtime for their own
purposes. The working directory is also under user control as well - create
a shortcut to the program, and the "Start In" field has direct effect on the
initial value that GetCurrentDirectory() returns.
Gambit |
|
| Back to top |
|
 |
Roger Guest
|
Posted: Fri Oct 27, 2006 7:28 pm Post subject: Re: detect software directory |
|
|
| Quote: |
How do I detect the directory of the software I'm running ( I want this
software to detect its own directory)
What about: |
AnsiString asPath = ExtractFilePath(Application->ExeName);
Roger |
|
| Back to top |
|
 |
Bruce Larrabee Guest
|
Posted: Sat Oct 28, 2006 5:45 pm Post subject: Re: detect software directory |
|
|
Roger wrote:
| Quote: | How do I detect the directory of the software I'm running ( I want this
software to detect its own directory)
What about:
AnsiString asPath = ExtractFilePath(Application->ExeName);
Roger
|
This is what I do.
Bruce |
|
| Back to top |
|
 |
|