I have a problem with ExtractFilePath in C++Builder 10 Seattle under Windows 10.
My simple program is as follows.
My application directory is ‘test2’ with a sub directory named ‘docs’.
-
AnsiString Path = ExtractFilePath(Application->ExeName);
-
Memo1->Lines->Add(Path);
-
OpenDialog1->InitialDir = Path + “docs”;
-
If (OpenDialog1->Execute()){
-
…
-
}
If I run the program in the IDE (Run F9) the result in my Memo for Path is C:\test2\.\
(The “.\” at the end of the Path looks strange)
The OpenDialog don’t show the directory ‘docs’ but stay in the Application Directory ‘test2’.
If I run the executable without debugging (Shift+Ctrl+F9) in the IDE than the result for Path is: C:\test2\ and the Opendialog shows the right ‘docs’ directory.
This is also the same if I run the program directly from the File Explorer.
Please can somebody tell me how to handle this problem?
Best Regards,
Roland