Re: how to call dll [message #44756 is a reply to message #44753] |
Thu, 14 July 2005 22:28   |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
rzsh5 wrote:
> I want to know if I have a dll file in a certain folder, how can I call
> it in IDL. I have tried DLM_LOAD to load idl_netcdf.dll but too many
> errors occured. someone said I can use call_external to load dll. Can
> anybody give me some suggestions and examples about how to call dll in
> IDL.
It depends on the DLL.
On my system, idl_netcdf.dll is in
D:\Program Files\RSI\IDL61\bin\bin.x86\
Also in this directory is idl_netcdf.dlm. The latter is a *text* file
which contains stuff like
MODULE NCDF
DESCRIPTION IDL NetCDF support
VERSION 3.5.0
SOURCE Research Systems, Inc.
BUILD_DATE JUL 14 2004
CHECKSUM xxxxx
FUNCTION NCDF_ATTCOPY 3 5 KEYWORDS
FUNCTION NCDF_ATTINQ 2 3 KEYWORDS
...
The directory in question is on the list of directories (by default
there's only one) in the system variable !DLM_PATH.
There's a section in the IDL External Development Guide that describes
how DLMS work (I'm reading it now--it's quite interesting). But if your
installation hasn't been tampered with and you haven't changed !DLM_PATH
you shouldn't have to worry about it. IDL reads idl_netcdf.dlm to find
out what routines are available in idl_netcdf.dll and then all those
routines work like magic.
RE DLM_LOAD, the documentation says:
Normally, IDL system routines that reside in dynamically loadable
modules (DLMs) are automatically loaded on demand when a routine
from a DLM is called. The DLM_LOAD procedure can be used to
explicitly cause a DLM to be loaded.
Interesting, but I've never had to worry about this before, so why
should you?
RE the suggestion that you should use CALL_EXTERNAL to load the DLL: no,
not in this case, as idl_netcdf.dll is meant to be used through the DLM
interface.
--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|