Not Interop Compatable?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using VB.NET as a GUI to perform some calculations which are done in a
FORTRAN DLL. In the validating event handler for a text box I call a
subroutine in the FORTRAN DLL to do some calculations with the value in the
text box.
I have verified using the FORTRAN debugger that the subroutine is being
called and all the arguments are passed as expected. When the DLL is done
and I return to my VB.NET code, the following error occurs.

"An unhandled exception of type 'System.ArgumentException' occurred in
WinAPS.exe
Additional information: Method's type signature is not Interop compatible."

I haven't been able to locate any info on what this means.
Anybody know what this is all about?
 
Ken,

I have declared the sub like this:
Declare Sub FServe Lib "FXAPS.dll" (ByVal ACTYPE As String, ByVal
STR_LEN As Integer, ByRef RFBKIN As Single, ByRef IFVOLM As Integer, ByRef
IFDENS As Integer, ByRef KFVOLM As Integer, ByRef RFDENS As Single, ByRef
ITANK As Integer, ByRef NT As Integer, ByRef FMETER As Single, ByRef FCOMP As
Single, ByRef FTOL As Single, ByRef KTANK() As Integer, ByRef WCFGTO As
Single, ByRef ERRMSG As Integer)

And call it like this:

Call FServe(sACType, iDummy, rFBkIn, iFVolm, iFDens, kFVolm, rFDens, iTank,
iNumTnk, rFMeter, rFComp, rFTol, kTank, rMTOGW, iERR)

This is how I would call some API if I were using some function not included
in the .NET framework. Am I missing something?

Thanks,
Erik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top