读书人

调用这个还是出有关问题 都传对了吧

发布时间: 2012-02-01 16:58:19 作者: rapoo

调用这个还是出问题 都传对了吧
[DllImport("user32.dll", EntryPoint = "SetWindowLongA", SetLastError = true)]//
private static extern long SetWindowLong(IntPtr hwnd, int nIndex, long dwNewLong);

SetWindowLong(appWin, GWL_STYLE, WS_VISIBLE);


检测到 PInvokeStackImbalance
Message: 对 PInvoke 函数“AppControl!

AppControl.ApplicationControl::SetWindowLong”的调用导致堆

栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名

不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标

签名是否匹配。


真不知道哪里不匹配了



[解决办法]
GWL_STYLE, WS_VISIBLE 有没有定义?

private const int GWL_STYLE = (-16);
private const int WS_VISIBLE = 0x10000000;

读书人网 >C#

热点推荐