Re: how to call dll [message #44751] |
Fri, 15 July 2005 05:19  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
You can't use these dlls from visual basic directly. all variable
definitions internally are tightly coupled to the idl api and won't run
standalone. This assessment is based on my own dlms and please correct me if
I am wrong. Can't you compile you own netcdf dll? This is open source,
right?
Haje
"rzsh5" <hui.shenhui@gmail.com> wrote in message
news:1121411020.324356.206110@z14g2000cwz.googlegroups.com.. .
> Thank you, Mark Hadfield. Actually, I have wrote a IDL program and
> merged this IDL program into visual basic. But when I did this, an
> error occurs, that is: synatx error about NCDF_OPEN. which shows the
> program can't load ncdf_open function. And when I remove the
> idl_netcdf.dll from bin\bin.x86, same errors occur in IDL. So, I want
> to try whether I can use these functions from idl_netcdf.dll directly.
> Thank you.
>
|
|
|
|
|
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)
|
|
|
Re: how to call dll [message #44845 is a reply to message #44752] |
Sun, 17 July 2005 15:20  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
rzsh5 wrote:
> Actually, I have wrote a IDL program and
> merged this IDL program into visual basic. But when I did this, an
> error occurs, that is: synatx error about NCDF_OPEN. which shows the
> program can't load ncdf_open function. And when I remove the
> idl_netcdf.dll from bin\bin.x86, same errors occur in IDL. So, I want
> to try whether I can use these functions from idl_netcdf.dll directly.
What do you mean by "wrote an IDL program and merged this IDL program
into Visual Basic"?
--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|