Results 1 to 3 of 3

Thread: Easy Public Declare ... question

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Princeton, New Jersey
    Posts
    46

    Easy Public Declare ... question

    When I am declaring a function from a DLL in a module, is it possible to variabilize the DLL that the function resides in (to allow for the DLL being located in different possible places)

    Such as:
    Public Declare API_Call Lib varDllPath (ByVal etc.....)

    When I declare a Constant varDllPath and try to use that in the Public Declare statement... I get an error... "expected string constant".

    Is there a way to variabilize the path to the DLL referenced in the declaration to allow for setting that at run-time?

    Thanks, Dale.

  2. #2
    DerFarm
    Guest
    ummmmm....isn't that the purpose of registering the DLL?

    My understanding is that when a DLL is registered, the operating
    system will find the silly thing no matter where the end-user
    stupidly put it. The path to the contents of the DLL is in the
    registry.

    If this is the case, then all you have to do is guarantee that the
    DLL has been registered. Presumably, you could check the
    register for the name of the DLL before comencing processing,
    and then put up a msgbox if you can't find it. I don't know how
    to do that, and it would probably be more trouble than it's worth.

    HTH

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Is there a way to variabilize the path to the DLL referenced in the declaration to allow for setting that at run-time?
    I believe you can use the API LoadLibrary and related APIs to load a DLL and call its functions, but I've never used it myself.
    http://msdn.microsoft.com/library/de...c/dll_0qr7.asp
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width