Article View: borland.public.cppbuilder.nativeapi
Article #12028Re: Get the path of a DLL
From: Remy Lebeau (TeamB)
Date: Mon, 29 Dec 2003 20:51
Date: Mon, 29 Dec 2003 20:51
16 lines
1679 bytes
1679 bytes
"Mike Collins" <mikec@kr8.co.uk> wrote in message news:3ff07bd5$1@newsgroups.borland.com... > Now when I've included this class in my DLL, it seems to be > returning the value of the calling application and NOT the DLL As well it should. ParamStr(0) returns the path of the calling process, not the calling module. A DLL is not its own process, it is injected into and calling in the context of the process that loads it. To get the path of the DLL itself, try calling the Win32 API GetModuleFileName() function directly, passing it the DLL's actual module handle as provided by DllEntryPoint(). Gambit
Technical Details
Message-ID:
<3ff09282$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!news-out.visi.com!petbe.visi.com!dimensional.com!pulsar.dimensional.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ff07bd5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2a267c1af3d1e27e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-29 13:02:59 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ff07bd5$1@newsgroups.borland.com> Subject: Re: Get the path of a DLL Date: Mon, 29 Dec 2003 12:51:19 -0800 Lines: 18 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.139.199 Message-ID: <3ff09282$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1072730754 67.22.139.199 (29 Dec 2003 12:45:54 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!news-out.visi.com!petbe.visi.com!dimensional.com!pulsar.dimensional.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail