|
-
October 7th, 1999, 01:24 AM
#1
Declared DLL file not found??
Hi,
I have the following declarations in my Module file:
Declare Sub InstallMyHook Lib "HookKB" (byval hWnd as Long)
Declare Sub UnInstallMyHook Lib "HookKB" (byval hWnd as Long)
HookKB.dll is a little dll written by me in MS VC++, and is installed in the Windows\System directory.
On my own computer, everything runs smoothly.
But when my VB program is run on another computer, I get a "File not found HookKB" error, although the HookKB.dll is installed properly into the Windows\System directory.
I even tried changing Lib "HookKB" to Lib "HookKB.dll". But it still doesn't work.
Why does this happen? Why does it work on my computer and not on another?
How do I resolve this? Help help.
Rgds,
Ming_Wah
-
October 7th, 1999, 02:04 AM
#2
Re: Declared DLL file not found??
if your target machine is an NT machine you should place the dll into the system32 directory.
If that doesn't work, try to specify a complete path: declare sub... lib "C:\windows\system32\...dll" (just for testing, of course).
-
October 13th, 1999, 03:31 AM
#3
Re: Declared DLL file not found??
I have the same problem as Mingwah has, and I installed my dll into the system32 direcory, I even specified a complete path, but it doesn't work either. It is confusing me, that it worked with VB 5, but it doesn't work with VB 6. Are there any files missing?
Regards Peter
-
October 13th, 1999, 03:35 AM
#4
Re: Declared DLL file not found??
Ok, then I'd try an explicit LoadLibrary(Ex) API call to explicitly load the DLL and see what the return code is (or what GetLastError (or err.LastDLLError) says). If you pass THAT to FormatMessage you should get a readable explanation of the reason for the failure.
You could also use the DEPENDS utility that comes with VS 6 to see what other components the offending DLL depends on.
-
October 13th, 1999, 04:33 AM
#5
Re: Declared DLL file not found??
Unfortunatly this didn't solve my problem either, because the returncode of the LoadLibrary API is 126 - "Module not found", but the dll is there! It works on my computer (on which VB6 is installed) but it doesn't work on a different computer (without installed VB6)
Regards Peter
-
October 13th, 1999, 05:14 AM
#6
Re: Declared DLL file not found??
then try the DEPENDS utility...
-
October 13th, 1999, 07:41 AM
#7
Re: Declared DLL file not found??
Yahoo! It was a useful track to the solution. The required dll was always in the correct directory, but my dll needs the PL/I-Runtime-Files, which are in a different directory (my dlls are written with PL/I). I just copied the runtime-files to the right directory - it works. Do you know where I can get the DEPENDS utility from , because I havn't got VS 6 (only VB 6)?
-
October 13th, 1999, 07:46 AM
#8
Re: Declared DLL file not found??
according to the docs it is supposed to be on the installation cd
\Common\Tools\VB\Unsupprt\Depend
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
|