Hi,
LoadLibrary doesn't register the DLL. Registering can be done in two ways:
calling the dll's function DllRegisterServer, or by calling the commandline
command regsvr32 "dll path". The second way it easier.
LabVIEW uses the LoadLibrary function internally to load the library. If you
do it yourself, you'll fail in the same way LabVIEW does. From the error you
get, there is a second dll that cannot be found, on which the first dll
depends.
LabVIEW (LoadLibrary) searches for a dll in the following order
Windows SDK>:
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.
4.. 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.
5.. The Windows directory. Use the GetWindowsDirectory function to get the
path of this directory.
6.. The directories that are listed in the PATH environment variable.
If it cannot be found in one of these places, LabVIEW (or perhaps windows)
prompts the user for it.
So you need to put the dll (and any libraries needed by it) in one of there
places.
Regards,
Wiebe.
"ky" wrote in message
news:50650000000500000070230100-1042324653000@exchange.ni.com...
> Hi Wiebe,
>
> You are right, I need to browse for the dll every time. But, I had the
> problem to register the dll as you suggested, i.e
> LoadLibrary("FLASH_START.dll") failed. "One of the library files
> needed to run this application cannot be found." Do you have any idea
> about this? It cannot works if the dll put in the system path. Could
> you explain further on method (c)?
> Thanks.