🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.migration
5 messages
5 total messages Started by Gene Sat, 28 Jun 2008 07:57
ExtractFilePath doesn't work when I upgrade my project from BCB6.
#123
Author: Gene
Date: Sat, 28 Jun 2008 07:57
13 lines
1277 bytes
Hi,

I don't know why the function ExtractFilePath doesn't work on me when I ugraded my project from BCB6. The code is here:

  AnsiString FName = Application->ExeName;
  AnsiString path = ExtractFilePath(FName);

path is Null. It is strange. I did test on a brand new project made under C++ Builder 2007, the function works. I don't know why. Has any one had that problem before? Any clue of what is going on? 

Thanks.

Gene.
Re: ExtractFilePath doesn't work when I upgrade my project from BCB6.
#124
Author: Gene
Date: Sun, 29 Jun 2008 01:21
5 lines
1096 bytes

That seemed silly. I turned off "Old-style class parameter argument", then the extractfilepath worked.

Gene.
Re: ExtractFilePath doesn't work when I upgrade my project from BCB6.
#125
Author: Remy Lebeau (TeamB)
Date: Mon, 30 Jun 2008 04:59
15 lines
1355 bytes
"Gene" <shenjige@yahoo.ca> wrote in message 
news:4865eef2$1@newsgroups.borland.com...

>  AnsiString FName = Application->ExeName;
>  AnsiString path = ExtractFilePath(FName);
>
> path is Null.

The only way that can happen is if FName was empty string to begin with. 
That woul suggest the Win32 API GetModuleFileName() function failed inside 
of Application->ExeName somehow.


Gambit 
Re: ExtractFilePath doesn't work when I upgrade my project from BCB6.
#134
Author: Larry Griffiths
Date: Mon, 07 Jul 2008 20:28
29 lines
1625 bytes
We have something strange with ExtractFilePath(Application->ExeName) but if 
I remember correctly the Application.Exe name has some ../ in it to go up a 
level and then down to a directory.

We used to just get the absolute path I think.

Larry.



"Gene" <shenjige@yahoo.ca> wrote in message 
news:4865eef2$1@newsgroups.borland.com...
>
> Hi,
>
> I don't know why the function ExtractFilePath doesn't work on me when I 
> ugraded my project from BCB6. The code is here:
>
>  AnsiString FName = Application->ExeName;
>  AnsiString path = ExtractFilePath(FName);
>
> path is Null. It is strange. I did test on a brand new project made under 
> C++ Builder 2007, the function works. I don't know why. Has any one had 
> that problem before? Any clue of what is going on?
>
> Thanks.
>
> Gene.
> 
Re: ExtractFilePath doesn't work when I upgrade my project from BCB6.
#135
Author: Remy Lebeau (TeamB)
Date: Mon, 07 Jul 2008 21:55
18 lines
1567 bytes
"Larry Griffiths" <nospame@nowhere.com> wrote in message 
news:48727c48$1@newsgroups.borland.com...

> We have something strange with ExtractFilePath(Application->ExeName)
> but if I remember correctly the Application.Exe name has some ../ in it to
> go up a level and then down to a directory.

The Application->ExeName property cannot return such a value.

> We used to just get the absolute path I think.

The Application->ExeName property getter calls ParamStr(0), which calls 
GetModuleFileName(), which always returns an absolute path to the file that 
the calling process was spawned from.


Gambit 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads