|
-
April 13th, 2003, 03:51 AM
#1
Where should the dll be put?
I build a dll of hook
but i discover that
I can put it at many dirs
and run it success
for a example...
my exe at
C:\abc\def\exe.exe
I can run it success when the dll at
C:\abc\hook.dll
C:\abc\def\hook.dll
C:\window\hook.dll
why?
my exe and dll at different dirs
why I can run it success?
there are so many dirs I can put and run success!!
than....where should i put the dll????
-
April 13th, 2003, 04:11 AM
#2
usually in the same dir or your exe ,
but most of them are in the windows\system32
or in the winnt\system32
Bengi
-
April 13th, 2003, 04:59 PM
#3
i guess you can put it anywhere.
I put the one i am using in my folder and used regsvr32 to register the dll.
So i guess it depends on your dll and where u want to put it.
Regards,
Preetham.
"All you touch and all you see is all you'll ever be"
-
April 14th, 2003, 01:01 AM
#4
That depends on what kind of dll you are creating.
If I create a COM dll, then the registration is thru regsvr32. I can keep this dll anywhere in the machine.
If I have to create a win32 dll and use it via LoadLibrary method, regsvr32 is not necessary. In this case, if you don't specify a complete path, the program will try to search in the current path/windows/system32 etc.,
Muthu
-
April 14th, 2003, 06:34 AM
#5
oh....
thank you a lot
now i know that why it can run success when the dll and prog at different dirs
-
April 15th, 2003, 09:25 PM
#6
This is taken from MSDN
The Search Path Used by Windows to Locate a DLL
Home | Overview | How Do I | FAQ | Details | Sample
With both implicit and explicit linking, Windows first searches the set of pre-installed DLLs such as the performance library (KERNEL32.DLL) and the security library (USER32.DLL). Windows then searches for the DLLs in the following sequence:
The directory where the executable module for the current process is located.
The current directory.
The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
Note that the LIBPATH environment variable is not used.
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
|