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) ...
 
相关文章
|
7月前
|
SQL Windows Perl
Configuring Automated Maintenance Tasks
Configuring Automated Maintenance Tasks
46 0
|
资源调度
There appears to be trouble with your network connection.Retrying
There appears to be trouble with your network connection.Retrying
2037 0
There appears to be trouble with your network connection.Retrying
|
前端开发
Warning: This synthetic event is reused for performance reasons.
Warning: This synthetic event is reused for performance reasons.
525 0
Warning: This synthetic event is reused for performance reasons.
|
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.
1642 0
Uptime And Monitoring Strategies For Cloud-Based E-Commerce Applications/Websites
In order to keep your e-commerce site functioning properly, you need to take positive steps to monitor both its performance and functionality.
1522 0
|
网络协议 Apache 开发工具