|
-
Feb 5th, 2002, 10:02 AM
#1
Thread Starter
Member
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.
-
Feb 5th, 2002, 10:23 AM
#2
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
-
Feb 5th, 2002, 11:16 AM
#3
Black Cat
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|