Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 解决方案

简介: because regular C functions work differently than the Windows API functions; their "calling conventions" are different, meaning how they pass around parameters is different.

because regular C functions work differently than the Windows API functions; their "calling conventions" are different, meaning how they pass around parameters is different. (This was hinted at in the error.)

 

所以请在C#中 使用CallingConvention = CallingConvention.Cdecl),代码如下:

[DllImport("CommonNativeLib.dll", CallingConvention = CallingConvention.Cdecl)]

或者 在C++中:
extern "C" __declspec(dllexport) int __stdcall Add(int a, int b) ...
 
相关文章
|
1月前
|
SQL Windows Perl
Configuring Automated Maintenance Tasks
Configuring Automated Maintenance Tasks
17 0
|
Oracle 关系型数据库 Unix
|
XML 数据格式
Some more technical details about SAP note
I use this note 2184333 which I am responsible for as an example:
121 0
Some more technical details about SAP note
|
JavaScript 前端开发
Guidelines for Function Compute Development - Troubleshoot Timeout Issues
Endless codes and endless bugs When you write code, you may inadvertently introduce some hidden bugs, even if you test a large proportion of the codes to the maximum extent possible.
1598 0