the following function may be useful to return where the dll resides:
function GetDLLName : String;
var
Buffer: array[0..MAX_PATH{260}] of Char;
begin
SetString(Result, Buffer, GetModuleFileName(HInstance, Buffer,
SizeOf(Buffer)))
end;
use extractfilepath(GetDLLName) if you only want the path
To return the physical location of the web site get the server var:
PATH_TRANSLATED
I use this to navigate to a site-specific ini file when the dll may be
shared by multiple sites.
hth,
Steve
> -----Original Message-----
> From: C Fraser [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 16 August 2001 11:58
> To: Multiple recipients of list delphi
> Subject: [DUG]: Some ISAPI Questions...
>
>
> Hi all,
>
> I just have some questions on building ISAPI dlls.
>
> First... I want to find the dir where my dll is running. The
> PathTranslated seems to return wrong information. From the
> documentation
> it looks like PathTranslated is what I want, but it doesn't work as
> expected.
>
> On the web server machine I have a Home directory as
> D:\Inetpub\wwwroot
> (not to sure what a home directory exactly means). I also
> have a virtual
> directory /Test which points to D:\InetPub\Test. My ISAPI
> ISAPITest.dll
> is located in D:\InetPub\Test\Scripts.
>
> From a web browser, I can go
> computername/Test/Scripts/ISAPITest.dll/Test and I get a path
> translated
> D:\Inetpub\Test which is correct, all fine and dandy.
>
> Then I go computername/Test/Scripts/ISAPITest.dll/Test2 and I
> get a path
> translated D:\Inetpub\wwwroot\Test2.
>
> So it seems if my URL path matches my directory path all
> seems to work.
> If my URL path does not match (which will usually be the
> case) I get the
> home directory coming in.
>
> To summarise... I am a bit confused! I just want to get the path to my
> dll in code so I can use this in the generated html scripts to make it
> easier to move the dll from server to server, directory to
> directory...
>
> I have other questions... But I shall try and solve this one first.
>
> Any help appreciated.
>
> Regards
> Colin
>
>
> ######################################################################
> Attention:
> The information in this email and in any attachments is
> confidential.
> If you are not the intended recipient then please do not distribute,
> copy or use this information. Please notify us immediately by return
> email and then delete the message from your computer.
> Any views or opinions presented are solely those of the author.
> ######################################################################
> --------------------------------------------------------------
> -------------
> 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/