if the dll is installed in the same dir as the exe then try something like:
function GetDLLName: string;
var
Buffer: array[0..MAX_PATH {260}] of Char;
begin
SetString(Result, Buffer, GetModuleFileName(HInstance, Buffer,
SizeOf(Buffer)))
end;
regards,
Steve
> -----Original Message-----
> From: James Sugrue [mailto:[EMAIL PROTECTED]
> Sent: Friday, 21 March 2003 9:37 a.m.
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Getting the FullPath of running application
>
>
> It would be the current executable. User clicks on a desktop
> shortcut to run
> the app, and the local path could be different, depending on
> the who was
> using. I.E could be e:\blah or f:\blah or //someserver/blah
>
> This is not a Delphi App. COBOL has no paramstr(0) equivalent
> under Windows.
> I thought I could compile a Delphi dll and link it into the
> COBOL program.
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, 21 March 2003 9:13 am
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Getting the FullPath of running application
>
>
> Just to clarify -- you mean for another, arbitrary executable? Not
> the current executable, which paramstr(0) provides?
>
> > Does anyone know of an API call to get the Full Path Name of an
> executable. It needs to be a WinApi call, because I want to
> export it in a
> .dll to a COBOL program.
> >
> > I am pretty sure GetFullPathName only returns the current directory.
> >
>
>
> cheers,
> peter
>
> ===========================================
> Peter Hyde, SPIS Ltd, Christchurch, New Zealand
> * TCompress/TCompLHA component sets for Delphi/Kylix/C++
> * TurboNote+: http://TurboNote.com -- top-rated onscreen sticky notes
> Find all the above and MORE at http://spis.co.nz
>
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/