Hi,
I’m trying to get a very basic app up and running to access header (keyword) information in astronomy fits files. I have compiled the latest version of cfitsio.dll and have it in the same folder as my build.
I’m trying to call functions within the dll and output a simple msgbox to show it works like this:
Soft Declare Sub fits_open_memfile Lib "cfitsio.dll" Alias "fits_open_file" (ByVal status As Ptr, ByVal filename As CString, ByVal mode As Int32, ByRef fptr As Ptr)
Soft Declare Sub fits_close_file Lib "cfitsio.dll" Alias "fits_close_file" (ByRef fptr As Ptr, ByRef status As Ptr)
Soft Declare Sub fits_read_key_str Lib "cfitsio.dll" Alias "fits_read_key_str" (ByRef fptr As Ptr, ByVal keyname As CString, ByVal keyval As CString, ByVal comm As CString, ByRef status As Ptr)
Dim status As Ptr
Dim fptr As Ptr
Dim keyval, comm As String
' Open the FITS file
fits_open_file(status, "F:/test.fit", 0, fptr)
' Read a specific key from the header
fits_read_key_str(fptr, "FILTER", keyval, comm, status)
' Close the FITS file
fits_close_file(fptr, status)
' Display the key value
MsgBox("Filter: " + keyval)
I’m getting FunctionNotFoundException, although I know the fits_open_memfile is in the dll.
What am I doing wrong with this? Any help would be great.
Thanks,
Jason.
7 posts - 5 participants