Home > database >  For help on a DLL call
For help on a DLL call

Time:09-22

You need to call an external DLL function, the DLL function description is:
Int nc_open (const char * path, int omode, int * ncidp)

Then I did in the pb definition is as follows:
The function int nc_open (ref string dogbytes, int dogaddr, int dogdata) library "netcdf. DLL" alias for "nc_open
"
Applications made the following call:

String ls_docname, ls_named
The integer li_value
CONSTANT integer NC_NOWRITE=0
Li_value=https://bbs.csdn.net/topics/GetFileOpenName (" open file ", ls_docname ls_named, "the CDF", "chromatography files (*. The CDF), *. The CDF,")
IF li_value & lt;> 1 THEN return
The integer li_ncid li_retval;
Li_retval=nc_open (ls_docname NC_NOWRITE, li_ncid)
But always in the last sentence error error calling external function % s line at 7 in the click event

What is where there is a problem?

CodePudding user response:

 PB? 
PB10 below:
The function long nc_open (ref string dogbytes, long dogaddr, ref long dogdata) library "netcdf. DLL" alias for "nc_open
"PB10 or above:
The function long nc_open (ref string dogbytes, long dogaddr, ref long dogdata) library "netcdf. DLL" alias for "nc_open; ANSI
"

CodePudding user response:

First of all thank xuam answer, I press you changed (pb9), because you are long, so I also changed to long in the program, still cannot pass, in the error message, seems to be caused by the second ref, remove the second, errors would be as good as the original

CodePudding user response:

Look at the function name case is correct

CodePudding user response:

Thanks for yyoinge function case is correct, I really can't, I can send the file to you, could you help me have a look?

CodePudding user response:


Q: 865359042

CodePudding user response:

Try
The function Boolean nc_open (string dogbytes, int dogaddr, int dogdata) library "netcdf. DLL" alias for "nc_open

CodePudding user response:

The function int nc_open (ref string dogbytes, int dogaddr, ref int dogdata) library "netcdf. DLL" alias for "nc_open
"

CodePudding user response:

Described by xuam brother's statement, because your DLL need a pointer to an int, so you must use the ref

Try li_ncid initialized before use the
Li_ncid=0
Then the calling function
  • Related