Not Interop Compatable?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Engineerik

    #1

    Not Interop Compatable?

    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.Argumen tException' 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 Tucker [MVP]

    #2
    Re: Not Interop Compatable?

    Hi,

    I believe that you have to call the functions in the dll like an
    api.

    http://msdn.microsoft.com/library/de...indowsAPIs.asp

    Ken
    ------------------------------
    "Engineerik " <Engineerik@dis cussions.micros oft.com> wrote in message
    news:3061F3A5-46D4-4179-9831-5AB66493B397@mi crosoft.com...[color=blue]
    >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.Argumen tException' 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?
    >
    >[/color]


    Comment

    • Engineerik

      #3
      Re: Not Interop Compatable?

      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


      "Ken Tucker [MVP]" wrote:
      [color=blue]
      > Hi,
      >
      > I believe that you have to call the functions in the dll like an
      > api.
      >
      > http://msdn.microsoft.com/library/de...indowsAPIs.asp
      >
      > Ken
      > ------------------------------
      > "Engineerik " <Engineerik@dis cussions.micros oft.com> wrote in message
      > news:3061F3A5-46D4-4179-9831-5AB66493B397@mi crosoft.com...[color=green]
      > >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.Argumen tException' 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?
      > >
      > >[/color]
      >
      >
      >[/color]

      Comment

      Working...