There are two possible reasons why LoadLibrary cannot load the Bridge DLL.
To solve this problem, first test to see if it is a system path issue. Modify the following code so that it reflects the path and bridge DLL filename of the version of Dyalog that you are using:
Code: Select all
r←dll_test;LoadLibrary;GetLastError;GetEnvironmentVariable
r←⍬
'LoadLibrary'⎕NA'u kernel32|LoadLibrary* <0T'
⎕NA'u kernel32|GetLastError'
'GetEnvironmentVariable'⎕NA'u kernel32|GetEnvironmentVariable* <0T >0T U'
r,←LoadLibrary⊂'bridge121_unicode.dll'
r,←GetLastError
r,←LoadLibrary⊂'C:\Program Files\Dyalog\Dyalog APL 12.1\bin\bridge121_unicode.dll'
r,←GetLastError
'GetEnvironmentVariable'⎕NA'u kernel32|GetEnvironmentVariable* <0T >0T U'
r,←GetEnvironmentVariable'PATH' 4096 4096
If LoadLibrary works in both cases, the first 4 numbers of the result r look like this:
192806912 0 192806912 0
If the second and fourth numbers are not 0, they are the error codes that GetLastError gave.
To solve the system path issue:
- Find the bridge DLL in the bin subdirectory of your install location.
Change the system path so that this directory is part of it.
Run the dll_test function again.
If you have followed the above steps, and the bridge DLL still does not load, your operating system may be missing DLLs that the bridge DLL requires. To find out which DLLs are missing, use the Dependency Walker on it. You can download Dependency Walker from http://www.dependencywalker.com.