日期:2014-05-18  浏览次数:20719 次

调用这个还是出问题 都传对了吧
[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;