好的,我已经按照文档的最小细节进行了操作,但是在尝试调试和运行(F5)时,它仍然给出以下错误提示:
PInvokeStackImbalance被检测到 消息:对PInvoke函数'VistaControls!VistaControls.Dwm.NativeMethods :: DwmExtendFrameIntoClientArea'的调用已经使堆栈不平衡。这很可能是因为托管的PInvoke签名与目标非托管签名不匹配。请检查PInvoke签名的调用约定和参数是否与目标非托管签名匹配。
我不知道这是什么意思,也不知道如何解决!有人可以帮忙吗?有什么建议吗?
我以前用过这个,但这次却不起作用。我正在使用VS2010 Express C# WinForms,.NET 4(就像我很久以前第一次使用它时一样)。
谢谢
链接:http://windowsformsaero.codeplex.com/wikipage?title=Glass%20on%20WinForms&referringTitle=Documentation 是的,我注意到页面底部一个人做出的更正,并且我已经修复了它,但它仍然无法工作!
代码:
PInvokeStackImbalance被检测到 消息:对PInvoke函数'VistaControls!VistaControls.Dwm.NativeMethods :: DwmExtendFrameIntoClientArea'的调用已经使堆栈不平衡。这很可能是因为托管的PInvoke签名与目标非托管签名不匹配。请检查PInvoke签名的调用约定和参数是否与目标非托管签名匹配。
我不知道这是什么意思,也不知道如何解决!有人可以帮忙吗?有什么建议吗?
我以前用过这个,但这次却不起作用。我正在使用VS2010 Express C# WinForms,.NET 4(就像我很久以前第一次使用它时一样)。
谢谢
链接:http://windowsformsaero.codeplex.com/wikipage?title=Glass%20on%20WinForms&referringTitle=Documentation 是的,我注意到页面底部一个人做出的更正,并且我已经修复了它,但它仍然无法工作!
代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VistaControls.Dwm;
namespace One_Stop_Management
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.FillRectangles(Brushes.Black, new Rectangle[] {
new Rectangle(0, 0, this.ClientSize.Width, 30),
new Rectangle(this.ClientSize.Width - 30, 0, 30, this.ClientSize.Height),
new Rectangle(0, this.ClientSize.Height - 30, this.ClientSize.Width, 30),
new Rectangle(0, 0, 30, this.ClientSize.Height)
});
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
VistaControls.Dwm.DwmManager.EnableGlassSheet(this);
}
}
}
DwmExtendFrameIntoClientArea
函数的 P/Invoke 定义有问题,但是你需要发布你目前拥有的定义,以便任何人能够告诉你如何修复它。我的猜测是当应该使用IntPtr
时使用了int
。 - Cody Gray