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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added CallingConvention = CallingConvention.Cdecl
Now it is:
[DllImport("libnodave.dll" /*, PreserveSig=false */, CallingConvention = CallingConvention.Cdecl )]
Regards,
Pawel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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,
Hi,
I added CallingConvention = CallingConvention.Cdecl
Now it is:
[DllImport("libnodave.dll" /*, PreserveSig=false */, CallingConvention = CallingConvention.Cdecl )]
Regards,
Pawel