博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Windows XP style Explorer Bar使用问题说明
阅读量:4129 次
发布时间:2019-05-25

本文共 962 字,大约阅读时间需要 3 分钟。

要想在vs2005中实现这样的效果,是没有相应的组件的,我使用的是codeproject

上的Windows XP style Explorer Bar  将XPExplorerBar.dll添加到工具箱后,在使用时

但是会出现如下错误:

in visual studio 2005:

PInvokeStackImbalance was detected
Message: A call to PInvoke function 'XPExplorerBar!XPExplorerBar.NativeMethods::LoadBitmap' 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.
the error is raised in the following line in GetResourceBMP method
IntPtr hBitmap = NativeMethods.LoadBitmap(hModule, Int32.Parse(resourceName));

 

这是由于winAPI中的long是32位,C#long是64位,生成可以成功,但是在执行后当然会出现堆栈不平衡的问题,在 vs2003中是捕获不出来的,但是在vs2005中是必须要处理的。

解决方法:

NativeMethods.cs中将

static extern IntPtr LoadBitmap(IntPtr hInstance, long resourceID)

中的long  换为int再重新生成即可。

我已经生成好.dll 文件并发布到我的资源里。

 

如有问题大家可以给我发邮件。

 

下载地址:

 

参考网站:

.NET1.1升级到.NET2.0时出现的PInvokeStackImbalance错误

 

你可能感兴趣的文章
leetcode刷题118 杨辉三角 Pascal's Triangle(简单) Python Java
查看>>
leetcode刷题125 验证回文串 Valid Palindrome(简单) Python Java
查看>>
leetcode刷题171 Excel表列序号 Excel Sheet Column Number(简单) Python Java
查看>>
leetcode刷题172 阶乘后的零 Factorial Trailing Zeroes(简单) Python Java
查看>>
leetcode刷题189 旋转数组 Rotate Array(简单) Python Java
查看>>
leetcode刷题190 颠倒二进制位 Reverse Bits(简单) Python Java
查看>>
leetcode刷题191 位1的个数 Number of 1 Bits(简单) Python Java
查看>>
NG深度学习第一门课作业1 构建一个逻辑回归分类器来识别猫
查看>>
leetcode刷题198 打家劫舍 House Robber(简单) Python Java
查看>>
NG深度学习第一门课作业2 通过一个隐藏层的神经网络来做平面数据的分类
查看>>
leetcode刷题202 快乐数 Happy Number(简单) Python Java
查看>>
leetcode刷题204 计数质数 Count Primes(简单) Python Java
查看>>
NG深度学习第一门课作业3-1 构建深度神经网络做图像处理
查看>>
NG深度学习第一门课作业3-2 构建深度神经网络做图像处理
查看>>
leetcode刷题234 回文链表 Palindrome Linked List(简单) Python Java
查看>>
NG深度学习第二门课作业1-1 深度学习的实践
查看>>
NG深度学习第二门课作业1-2 深度学习的实践
查看>>
leetcode刷题242 有效的字母异位词Valid Anagram(简单) Python Java
查看>>
NG深度学习第二门课作业1-3 深度学习的实践
查看>>
leetcode刷题268 缺失数字 Missing Number(简单) Python Java
查看>>