Delphi and Kylix

Moderators: pritaeas
Number of threads: 7260
Number of posts: 19067

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to get DLL Path Posted by arash82 on 10 May 2002 at 9:30 AM
How do I get the Full Path for a DLL (e.g. C:\mydll.dll).

With applications you can use ParamStr(0), but if I use the ParamStr(0) function I get the Path of the application that calls the DLL.
Report
Re: How to get DLL Path Posted by arash82 on 10 May 2002 at 9:59 AM
Hi,

I found the answer. Sorry if I was too rushed in putting out the question but here is the answer anyway. Maybe someone else will find it useful :)

library MyDLL;

...

procedure ShowLibraryPath;
var
  Buffer: Array[0..260] of Char;
begin
  GetModuleFileName(hInstance, Buffer, Length(Buffer));
  ShowMessage(Buffer);
end;

Report
Re: How to get DLL Path Posted by heinduplessis on 11 Mar 2011 at 12:57 AM
Awesome thanks, helped me!!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.