?
Solved

ISAPI Dll path

Posted on 2002-07-02
3
Medium Priority
?
1,014 Views
Last Modified: 2012-06-27
How can I get the path to an ISAPI dll?

With a CGI You can get the path using ExtractFilePath(ParamStr(0)) which returns something like : c:\inetpub\wwwroot\cgi-bin\ ie the location of the cgi executable

Using the same within an ISAPI dll returns C:\WINNT\System32\ ie not the location of the dll.
0
Comment
Question by:StevenB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
TOndrej earned 400 total points
ID: 7126236
ParamStr(0) returns the file name of the executable used to create the current process. That means that when called from a DLL you get the file name of the .exe that loaded the DLL not the file name of the DLL itself.

Instead you can use GetModuleFileName API:

function GetThisModuleFileName: string;
var
  Buf: array[0..MAX_PATH + 1] of Char;
begin
  SetString(Result, Buf, GetModuleFileName(HInstance, Buf, SizeOf(Buf)));
end;

HTH
TOndrej
0
 
LVL 3

Expert Comment

by:rondi
ID: 7126283
function GetModulePath: string;
const
  ModNamelen = MAX_PATH * 2 + 1;
var
  ModName: PChar;
  fname: string;
begin
  ModName := StrAlloc(ModNameLen);
  GetModuleFileName(HInstance,ModName,ModNameLen);
  Result := ExtractFilePath(StrPas(ModName));
  StrDispose(ModName);
end;
0
 
LVL 4

Author Comment

by:StevenB
ID: 7129160
Thanks both of you, that works great.

sorry rondi, TOndrej just beat you to it :o)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question