🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17264

Re: Does a DLL know its own path?

#17264
From: Nick B. Cassos
Date: Tue, 01 Apr 2003 15:47
22 lines
1531 bytes
On Tue, 1 Apr 2003 16:57:55 +0200, "nicolasr"
<nicolasrNOSPAMATSIGNgmx.net> wrote:

>Hi,
>
>I'm writing a pure WinAPI DLL. Is there a way from within the DLL to get at
>the path of the DLL ?
>
>thanks,
>Nick
>

I think, you should start with GetModuleFileName() to obtain the path
of your DLL's process. Armed with this info, you can follow Window's
logic to look first in the process's directory, then the current one,
system, windows, and anything in the PATH environment string. If there
are 2 or more instances of your DLL in several directories then I give
up.

-- 

Nick B. Cassos
Technical Details
Message-ID: <ikcj8vkkoh627qccc57je6qv2d1uruhav1@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e89a8e5$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9b751bad45db0bc8
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-01 07:53:37 PST
From: Nick B. Cassos <nbc@no_spam.ath.forthnet.gr>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Does a DLL know its own path?
Date: Tue, 01 Apr 2003 18:47:31 +0300
Message-ID: <ikcj8vkkoh627qccc57je6qv2d1uruhav1@4ax.com>
References: <3e89a8e5$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.16.148.65
X-Trace: newsgroups.borland.com 1049212047 213.16.148.65 (1 Apr 2003 07:47:27 -0800)
Lines: 22
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail