none
A new guard page for the stack cannot be created RRS feed

  • Question

  • Hi,

    while exiting some windows forms application am getting below 2 errors.

    Could any one help me why this errors will occur

    1. Error creating window handle.@   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
       at System.Windows.Forms.Control.CreateHandle()
       at System.Windows.Forms.Control.get_Handle()
       at System.Windows.Forms.Control.get_WindowText()
       at System.Windows.Forms.Control.set_CacheTextInternal(Boolean value)
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
       at System.Windows.Forms.Control.WmPaint(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    2. Invalid window handle@   at MS.Win32.SafeNativeMethods.SetTimer(HandleRef hWnd, Int32 nIDEvent, Int32 uElapse)
       at System.Windows.Threading.Dispatcher.SetWin32Timer(Int32 dueTimeInTicks)
       at System.Windows.Threading.Dispatcher.UpdateWin32TimerFromDispatcherThread(Object unused)
       at System.Windows.Threading.Dispatcher.UpdateWin32Timer()
       at System.Windows.Threading.Dispatcher.AddTimer(DispatcherTimer timer)
       at System.Windows.Threading.DispatcherTimer.Restart()
       at System.Windows.Threading.DispatcherTimer.Start()
       at System.Windows.Media.MediaContext.CommitChannelAfterNextVSync()
       at System.Windows.Media.MediaContext.NotifyPresented(MIL_PRESENTATION_RESULTS presentationResults, Int64 presentationTime, Int32 displayRefreshRate)
       at System.Windows.Media.MediaContext.NotifyChannelMessage()
       at System.Windows.Media.MediaContextNotificationWindow.MessageFilter(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Philips.PmsCT.Forms.ProgressManager.progressThread()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    After this error we are seeing the below dialog

    

    Plese help me how to resolve this error.

    • Moved by Stanly Fan Tuesday, March 13, 2018 1:45 AM
    Wednesday, March 7, 2018 1:22 PM

All replies

  • Hi Avatar,

    I'm afraid you need to provide more details for your problem, did you use some 3rd controls or components in your winform project?

    Please refer to the following similar threads for this issue:

    “Error Creating Window Handle”

    Winforms issue - Error creating window handle [duplicate]

    Handling invalid window handle

    A new guard page for the stack cannot be created

    Note: I noticed that you asked the same question in the following thread, if it is related to 3rd controls or components, please contact the provider for help.

    A new guard page for the stack cannot be created.

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 8, 2018 2:55 AM
  • Yes we are using xilium cefglue browser on my windows forms
    Thursday, March 8, 2018 6:51 AM
  • Hi Avatar,

    I'm afraid it is related to xilium, it will be more appropriate to ask your question at xilium forum.

    Thank you for your understanding.

    Regards,

    Frankie

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 8, 2018 7:05 AM
  • Am not seeing any errors in xilium cef logs.

    Thursday, March 8, 2018 7:06 AM
  • Hi,

    We can not get the real reason just from the above logs you provided, I'm not sure if it is not related to the 3rd control or component, just as I said, you need to provide more details for this problem instead of just some log messages, then have you tried the solutions I provided above?

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Avatar 123 Thursday, March 8, 2018 7:17 AM
    • Unmarked as answer by Avatar 123 Thursday, March 8, 2018 7:17 AM
    Thursday, March 8, 2018 7:14 AM
  • Yes you are right.. by seeing at the logs i felt that there is a timer which we are not disposing and now i made changes to dispose.. in second log i see some timer related error. so i just want to confirm the same
    Thursday, March 8, 2018 7:17 AM
  • Yes you are right.. by seeing at the logs i felt that there is a timer which we are not disposing and now i made changes to dispose.. in second log i see some timer related error. so i just want to confirm the same

    Hi,

    What do you mean about this? So have you solved it now? If so, please close this thread by marking the solution as answer, if not, as I said above, maybe you can provide a demo with Microsoft OneDrive for my test.

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 8, 2018 7:29 AM