?
Solved

GetCurrentDir on windows boot acting funny!

Posted on 2003-03-23
6
Medium Priority
?
283 Views
Last Modified: 2010-04-04
Hi Guys.
I use GetCurrentDir to get the, er, Current dir. It works fine, I call it in the Initialization section of my program.

I added my software to the start-up of windows (using the registry, at currentsoftware/M$/windows/run or something like that) and then the function simply returns "c:\". Even if I move it out of the Initialization part and to the 'Activate' of the form or something, it still does that. What gives?

Cheers,

Tsh.
0
Comment
Question by:ShadowHawk071998
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
esoftbg earned 500 total points
ID: 8190748
var
  CurrDir: string;
begin
  CurrDir := ExtractFilePath(Application.ExeName);
end;
0
 
LVL 7

Expert Comment

by:Motaz
ID: 8190758
You can use ExtractFilePath(ParamStr(0)) to extract your current path even if you assign different working directory than the directory in which you put your exe file.

Example:

if your program started from d:\test\first.exe
then that function will return:
d:\test\

Motaz
0
 

Author Comment

by:ShadowHawk071998
ID: 8197215
Hi. This works great. But what do I do about the points?
Esoftbg helped first and his answer works, But I think Motaz also answers. Should I give points to the first one? or both somehow?

T.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Expert Comment

by:Motaz
ID: 8197715
it is enough to give points for first answer
Motaz
0
 

Author Comment

by:ShadowHawk071998
ID: 8200581
Cheers, and sorry Motaz ;-(
0
 

Author Comment

by:ShadowHawk071998
ID: 8200582
Simple, but it works great ;-)

T.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question