BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

detect software directory

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Renan
Guest





PostPosted: Thu Oct 26, 2006 9:52 pm    Post subject: detect software directory Reply with quote



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





PostPosted: Thu Oct 26, 2006 10:16 pm    Post subject: Re: detect software directory Reply with quote



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





PostPosted: Thu Oct 26, 2006 11:52 pm    Post subject: Re: detect software directory Reply with quote



"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





PostPosted: Thu Oct 26, 2006 11:53 pm    Post subject: Re: detect software directory Reply with quote

"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





PostPosted: Fri Oct 27, 2006 12:16 am    Post subject: Re: detect software directory Reply with quote

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





PostPosted: Fri Oct 27, 2006 12:21 am    Post subject: Re: detect software directory Reply with quote

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





PostPosted: Fri Oct 27, 2006 12:45 am    Post subject: Re: detect software directory Reply with quote

"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





PostPosted: Fri Oct 27, 2006 7:28 pm    Post subject: Re: detect software directory Reply with quote

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





PostPosted: Sat Oct 28, 2006 5:45 pm    Post subject: Re: detect software directory Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.