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

窗口继承CCSkinMain后,hide抛异常

[复制链接]
跳转到指定楼层
楼主
查看: 3075|回复: 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空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播
回复 论坛版权

使用道具 举报

沙发
 楼主| whwei01 发表于 2015-8-21 10:15:37 | 显示全部楼层
乔克斯 发表于 2015-8-20 09:11
试试this.Skin.hide();
或则关闭窗体Shadow阴影属性。
BUG已记录。

帮主大人
按照你的方法试了下还是不行啊
特别说明下
这个hide方法是放在线程中执行的
板凳
 楼主| whwei01 发表于 2015-8-21 11:46:05 | 显示全部楼层
乔克斯 发表于 2015-8-21 10:23
线程中执行需要委托主线程调用。
不能跨线程调用UI组件。

现在就是委托主线程调用的
您需要登录后才可以回帖 登录 | 加入CSkin博客

本版积分规则

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

Powered by Discuz! X3.2  © 2001-2013 Comsenz Inc.  Designed by ARTERY.cn
GMT+8, 2024-5-23 20:22, Processed in 0.733143 second(s), 31 queries , Gzip On.

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