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) ...
 
相关文章
|
6月前
|
SQL Windows Perl
Configuring Automated Maintenance Tasks
Configuring Automated Maintenance Tasks
41 0
|
2月前
|
SQL Java
flywa报错Detected resolved migration not applied to database: 20221103.10000
flywa报错Detected resolved migration not applied to database: 20221103.10000
49 2
|
3月前
|
机器学习/深度学习 JSON 网络协议
Nostr with NIP-05 Verification Guide
该文章是一个关于Nostr协议中NIP-05验证的指南,解释了NIP-05允许用户将公钥映射到基于DNS的可读标识符上,并提供了如何在个人域名上设置`nostr.json`文件或使用现有NIP-05服务来完成验证的步骤。
27 3
Nostr with NIP-05 Verification Guide
|
Oracle 关系型数据库 Unix
|
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.
1637 0