Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

netcdf.dll and Visual Basic 6

Hi,

I´ve got some problems using the netcdf.dll (prebuilt dll from the
netcdf-3.5.1 download) with Visual Basic 6.
In a new module I wrote the declaration:

Declare Function nc_open Lib "netcdf.dll" (ByVal path As String, ByVal
cmode As Long, ByRef ncidp As Long) As Long

Then I used it in a procedure:
Sub main
Dim path As String, ncidp As Long, res As Long
path = "c:\test.cdf"
res = nc_open(path, 0, ncidp)
End Sub

Running the program, I get the error message "Bad dll calling convention"

If the error is suppressed (with "OnError Resume Next") then I can read
some simple data from the *.cdf file. But if string variables or array
variables are involved, the program fails or even crashes.

I´ve got the impression from other netcdfgroup members that it is
possible to use the
netcdf.dll in the way outlined above.

Does anybody know what I am doing wrong? What calling convention does
the netcdf.dll uses?

With best regards

H.J. Rieger

-- 
GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail
+++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690