作者: whwei01
查看: 3036|回复: 8
打印 上一主题 下一主题

窗口继承CCSkinMain后,hide抛异常

[复制链接]
跳转到指定楼层
楼主
whwei01 发表于 2015-8-19 17:18:18 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
查看: 3036|回复: 8
有一个窗口继承自CCSkinMain
public partial class VidyoLogin: CCSkinMain

当Hide的时候报了如下一个异常错误


异常详细内容如下
未处理 System.ComponentModel.Win32Exception
  Message=参数错误。
  Source=System.Windows.Forms
  ErrorCode=-2147467259
  NativeErrorCode=87
  StackTrace:
       在 System.Windows.Forms.Form.UpdateLayered()
       在 System.Windows.Forms.Form.set_Opacity(Double value)
       在 CCWin.CCSkinMain.JGMy3Yu6ZbtMCmMAiIM(Object , Double )
       在 CCWin.CCSkinMain.OnVisibleChanged(EventArgs e)
       在 System.Windows.Forms.Control.WmShowWindow(Message& m)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       在 System.Windows.Forms.Form.WmShowWindow(Message& m)
       在 System.Windows.Forms.Form.WndProc(Message& m)
       在 CCWin.CCSkinMain.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       在 System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
       在 System.Windows.Forms.Control.SetVisibleCore(Boolean value)
       在 System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       在 System.Windows.Forms.Control.Hide()
       在 VidyoLogin.VidyoLogin.LoginVideoPanel() 位置 E:\CTIL\SVNCTIL\CTIL830012\Trunk\Vidyo Demo\VidyoDemo\VidyoDemo\VidyoLogin.cs:行号 102
       在 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       在 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       在 System.Threading.ExecutionContext.runTryCode(Object userData)
       在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       在 System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       在 System.Windows.Forms.Form.WndProc(Message& m)
       在 CCWin.CCSkinMain.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.Run(Form mainForm)
       在 VidyoLogin.Program.Main() 位置 E:\CTIL\SVNCTIL\CTIL830012\Trunk\Vidyo Demo\VidyoDemo\VidyoDemo\Program.cs:行号 18
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException:

请高手解答一下,多谢


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播
回复 论坛版权

使用道具 举报

沙发
乔克斯 发表于 2015-8-20 09:11:59 | 只看该作者
试试this.Skin.hide();
或则关闭窗体Shadow阴影属性。
BUG已记录。
板凳
 楼主| whwei01 发表于 2015-8-21 10:15:37 | 只看该作者
乔克斯 发表于 2015-8-20 09:11
试试this.Skin.hide();
或则关闭窗体Shadow阴影属性。
BUG已记录。

帮主大人
按照你的方法试了下还是不行啊
特别说明下
这个hide方法是放在线程中执行的
地板
乔克斯 发表于 2015-8-21 10:23:40 | 只看该作者
whwei01 发表于 2015-8-21 10:15
帮主大人
按照你的方法试了下还是不行啊
特别说明下

线程中执行需要委托主线程调用。
不能跨线程调用UI组件。
5#
 楼主| whwei01 发表于 2015-8-21 11:46:05 | 只看该作者
乔克斯 发表于 2015-8-21 10:23
线程中执行需要委托主线程调用。
不能跨线程调用UI组件。

现在就是委托主线程调用的
6#
乔克斯 发表于 2015-8-21 11:50:12 | 只看该作者
whwei01 发表于 2015-8-21 11:46
现在就是委托主线程调用的

不可能啊。。。
试试this.Skin.hide();
或则关闭窗体Shadow阴影属性。
之前很多人都是这2个问题。。就解决了。
或则你下载官网新版本试试。
www.cskin.net
7#
O.O 发表于 2015-12-7 12:58:50 | 只看该作者
我今天也遇到这个问题,找到原因了,TransparencyKey 属性去掉,这里只要设置了颜色或者透明就报错。

System.ComponentModel.Win32Exception (0x80004005): 参数错误。
   在 System.Windows.Forms.Form.UpdateLayered()
   在 System.Windows.Forms.Form.set_Opacity(Double value)
   在 CCWin.CCSkinMain.JGMy3Yu6ZbtMCmMAiIM(Object , Double )
   在 CCWin.CCSkinMain.OnVisibleChanged(EventArgs e)
   在 System.Windows.Forms.Control.WmShowWindow(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.Form.WmShowWindow(Message& m)
   在 System.Windows.Forms.Form.WndProc(Message& m)
   在 CCWin.CCSkinMain.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

QQ截图20151207125347.png (16.62 KB, 下载次数: 9)

评分

参与人数 1金钱 +1 收起 理由
feiyuan + 1 感谢分享,LZ辛苦了~

查看全部评分

8#
feiyuan 发表于 2020-12-24 19:08:26 | 只看该作者
谢谢答疑解惑,非常感谢
9#
feiyuan 发表于 2020-12-24 19:29:49 | 只看该作者
TransparencyKey 属性 右击点  重置,transparent也会报错,专门去试了下,真的是很大的bug,程序直接运行不了
您需要登录后才可以回帖 登录 | 加入CSkin博客

本版积分规则

QQ|申请友链|小黑屋|手机版|Archiver|CSkin ( 粤ICP备13070794号

Powered by Discuz! X3.2  © 2001-2013 Comsenz Inc.  Designed by ARTERY.cn
GMT+8, 2024-5-5 05:49, Processed in 0.616638 second(s), 32 queries , Gzip On.

快速回复 返回顶部 返回列表