Menu

PInvokeStackImbalance was detected(.NET;S7o )

Help
2007-08-10
2013-05-09
  • Nobody/Anonymous

    I trying to use .NET + S7online, but when I run testS7online.cs I geting error:

    testS7online.cs

    PInvokeStackImbalance was detected
    Message: A call to PInvoke function 'ConsoleApplication!libnodave::openS7online' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    (VCS2005)

    any idea?

    Regards,

    Pawel

     
    • GaboMX

      GaboMX - 2007-08-30

      Hey,
      I had the same problem with VB.net, the cause was the all my libnodave functions declarations were as long (in vb 6 the functions work as long) and I just changed them to integer. I am using the libnodave.dll and not the libnodave.net.dll. I prefered to write my own .net dll

      How do you declare the libnodave functions? as long or integer.

      Regards,

       
    • Nobody/Anonymous

      Hi,

      I added CallingConvention = CallingConvention.Cdecl
      Now it is:
              [DllImport("libnodave.dll" /*, PreserveSig=false */, CallingConvention = CallingConvention.Cdecl )]

      Regards,

      Pawel

       

Anonymous
Anonymous

Add attachments
Cancel