Article View: borland.public.cppbuilder.nativeapi
Article #17193Re: Does a DLL know its own path?
From: Ed Mulroy [TeamB]
Date: Wed, 02 Apr 2003 13:49
Date: Wed, 02 Apr 2003 13:49
23 lines
2051 bytes
2051 bytes
It could be loaded as a long file name by one process and as a short file name by another. Additionally it might have been loaded from a relative path in one and an absolute path by another and using a path set up with the subst command by yet another. I am not sure that all of these will alter the result of calling GetFullPathName but the SDK note seems to imply that it will. I think a way around that is to call GetFullPathName on the returned value from GetModuleFileName. That should give the same representation of path and file name independent of short vs long names and real vs subst paths. . Ed > Nick B. Cassos wrote in message > news:fv3l8v4q3fguthh808a3htirmii4lj4c0o@4ax.com... > > > The original poster asked for the path of his own DLL > and not of the process where the DLL is attached. > > According to SDK: "If a DLL is loaded in two processes, > its file name in one process may differ in case from its > file name in the other process."
Technical Details
Message-ID:
<3e8aea98$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e89a8e5$1@newsgroups.borland.com> <ikcj8vkkoh627qccc57je6qv2d1uruhav1@4ax.com> <3e89ba73@newsgroups.borland.com> <fv3l8v4q3fguthh808a3htirmii4lj4c0o@4ax.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-02 05:58:21 PST From: "Ed Mulroy [TeamB]" <ed@mulroy.org> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e89a8e5$1@newsgroups.borland.com> <ikcj8vkkoh627qccc57je6qv2d1uruhav1@4ax.com> <3e89ba73@newsgroups.borland.com> <fv3l8v4q3fguthh808a3htirmii4lj4c0o@4ax.com> Subject: Re: Does a DLL know its own path? Date: Wed, 2 Apr 2003 08:49:50 -0500 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 24.74.175.102 Message-ID: <3e8aea98$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049291416 24.74.175.102 (2 Apr 2003 05:50:16 -0800) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail