loadlibrary und DLL

J

Juergen

Hi,

I try to install a DLL called "tmWord.dll" with loadlibrary().

But this only works, when the runtime files of tmWord.dll are located
in the Word program folder.
The strange thing is, that tmWord.dll itself can be stored in another
folder.


Example:
tmWord.dll needs the runtime files: vo1.dll, vo2.dll,vo3.dll
tmWord.dll is stored at c:\progamme\myWord.

Therefore that all is working fine, Vo1.dll, vo2.dll and Vo3.dll have
to be stored in the progamm folder of MS Word!
Vo1-Vo3.dll can not be stored together with tmWord.dll in a separate
folder like c:\progamme\myWord.

Is there a possibility to store tmWord.dll and its runtime files in a
separate folder and in the program folder of MS Word?

Juergen
 
K

Karl E. Peterson

Juergen said:
I try to install a DLL called "tmWord.dll" with loadlibrary().

But this only works, when the runtime files of tmWord.dll are located
in the Word program folder.
The strange thing is, that tmWord.dll itself can be stored in another
folder.


Example:
tmWord.dll needs the runtime files: vo1.dll, vo2.dll,vo3.dll
tmWord.dll is stored at c:\progamme\myWord.

Therefore that all is working fine, Vo1.dll, vo2.dll and Vo3.dll have
to be stored in the progamm folder of MS Word!
Vo1-Vo3.dll can not be stored together with tmWord.dll in a separate
folder like c:\progamme\myWord.

Yeah, makes sense. That wouldn't be on the search path for LoadLibrary, which is:

1) The directory from which the application loaded.

2) The current directory.

Windows XP: If
HKLM\System\CurrentControlSet\Control\SessionManager\SafeDllSearchMode is 1, the
current directory is the last directory searched. The default value is 0.

3) The Windows system directory. Use the GetSystemDirectory function to get the
path of this directory.

Windows NT/2000/XP: The name of this directory is System32.

Windows NT/2000/XP: The 16-bit Windows system directory. There is no function that
obtains the path of this directory, but it is searched. The name of this directory
is System.

4) The Windows directory. Use the GetWindowsDirectory function to get the path of
this directory.

5) The directories that are listed in the PATH environment variable.
Is there a possibility to store tmWord.dll and its runtime files in a
separate folder and in the program folder of MS Word?

Well, there's Da Rulz. When it works from the Word folder, that's due to #1. You
could consider #5, I suppose? Another option, though by far the most fragile, is
#2. Of course, #3 and #4 are gimme's, but I don't think that really addresses your
question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top