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) ...
 
相关文章
|
4月前
|
SQL Windows Perl
Configuring Automated Maintenance Tasks
Configuring Automated Maintenance Tasks
35 0
|
1月前
|
机器学习/深度学习 JSON 网络协议
Nostr with NIP-05 Verification Guide
该文章是一个关于Nostr协议中NIP-05验证的指南,解释了NIP-05允许用户将公钥映射到基于DNS的可读标识符上,并提供了如何在个人域名上设置`nostr.json`文件或使用现有NIP-05服务来完成验证的步骤。
21 3
Nostr with NIP-05 Verification Guide
|
Oracle 关系型数据库 Unix
|
安全
Information Systems Security Assessment – Open information security framework
The Information Systems Security Assessment Framework (ISSAF) seeks to integrate the following m...
968 0
|
XML 数据格式
Some more technical details about SAP note
I use this note 2184333 which I am responsible for as an example:
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.
1628 0