Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to get DLL Path

arash82arash82 Member Posts: 106
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.

Comments

  • arash82arash82 Member Posts: 106
    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 :)

    [code]
    [b]library[/b] MyDLL;

    ...

    [b]procedure[/b] ShowLibraryPath;
    [b]var[/b]
    Buffer: Array[0..260] [b]of[/b] Char;
    [b]begin[/b]
    GetModuleFileName(hInstance, Buffer, Length(Buffer));
    ShowMessage(Buffer);
    [b]end;[/b]
    [/code]
  • heinduplessisheinduplessis Member Posts: 3
    Awesome thanks, helped me!!
  • Shawn CarterShawn Carter Member Posts: 0

    ___ / http://forcoder.org / free video tutorials and ebooks about / Ruby Python C++ Scratch Java R C C# Visual Basic .NET Visual Basic PL/SQL Swift Delphi JavaScript PHP Perl MATLAB Go Assembly Objective-C COBOL Dart Crystal Lua Prolog Ada Lisp Hack SAS LabVIEW Fortran D Awk ML Transact-SQL F# VBScript Julia Logo FoxPro Alice Rust Bash Kotlin ABAP Scala Erlang Apex Clojure Scheme / _______

Sign In or Register to comment.