-
Dll woes
Hi
Quick question about loading dlls. I used to have windows Malignant Edition and put my dll's into the windows system folder and everything was okay, now I have win 2000 and I cant get my dlls to load, where should they be placed? I have tried the various WINDOWS & WINNT system/system32 folders.
I load dlls like this
Code:
LibInst = LoadLibrary( "WH_KeyHook" );
hhk = SetWindowsHookEx( WH_GETMESSAGE, ( HOOKPROC ) &GetMsgProc, hInst, 0 );
the return values are checked for NULL so I assume all is okay there. My dlls should be fine to as they worked before, this driving me nuts.
-
Is WM_KeyHook.DLL somewhere in your search path?
Try using a full pathname in the call LoadLibrary().
If LoadLibrary() returns NULL, call GetLastError() to see why it failed.
gg
-
Win2000? Probably c:\WinNT\system32...
LoadLibrary uses the following list to look for dlls
Quote:
- The directory from which the application loaded.
- The current directory.
- The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
- The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
- The directories that are listed in the PATH environment variable.
Or you can use a custom directory and use LoadLibraryEx to load the dll
-
LOL, it was one of those stupid errors you dont want to admit to.
Heh heh, I changed the name of hInst to LibInst, but the complier didnt pick it up because I'd called something else hInst.
*slaps himself about the head with keyboard*