RadWindow ShowModal, latest internal hotfix build

4 posts, 1 answers
  1. Karin
    Karin avatar
    8 posts
    Member since:
    Aug 2008

    Posted 27 Jul 2011 Link to this post

    Hello,
    in order to fix another issue, I have upgraded to 2011.2.0725.40. My application used RadWindow.ShowModal and the second (!) window that is opened (after the first one is closed again) throws an exception as soon as the window is resized or dragged (both of which call BringToFront, as it seems). I noticed that in previous versions the window would get removed from the list of windows returned by RadWindowManager.GetWindows() as soon as ShowDialog() returns, in the newest version, it remains in the collection.

    mscorlib.dll!System.Collections.Generic.List<System.__Canon>.RemoveAt(int index) + 0xe1 bytes  
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowHostBase.BringToFront() Line 59   C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.BringToFront() Line 44 C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.BringToFront() Line 530 C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragStart(System.Windows.Point globalMousePosition, bool isResize) Line 1057   C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowHostBase.OnDragStart(System.Windows.Point globalMousePosition, bool isResize) Line 74 C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.TryBeginDragResize(System.IntPtr hwnd, bool isResizing) Line 301 C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.HandleMoving(System.IntPtr hwnd, System.IntPtr wParam, System.IntPtr lParam, out bool handled) Line 498  C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Line 563 + 0x5f bytes C#
    PresentationCore.dll!System.Windows.Interop.HwndSource.PublicHooksFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xcd bytes
    WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x13d bytes  
    WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x97 bytes   
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x5a bytes
    WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x47 bytes   
    WindowsBase.dll!System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) + 0x5d bytes   
    WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0xd2 bytes   
    WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x164 bytes   
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    WindowsBase.dll!MS.Win32.HwndSubclass.DefWndProcWrapper(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x7e bytes  
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x208 bytes   
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    WindowsBase.dll!MS.Win32.HwndSubclass.DefWndProcWrapper(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x7e bytes  
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x208 bytes   
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0x13a bytes
    PresentationFramework.dll!System.Windows.Window.ShowHelper(object booleanBox) + 0x20f bytes
    PresentationFramework.dll!System.Windows.Window.ShowDialog() + 0x5ae bytes 
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(bool isModal) Line 30 + 0x21 bytes   C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.ShowWindow(bool isModal) Line 615  C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadWindow.ShowDialog() Line 415   C#

    Update after further research: I have reproduced the problem in a sample application, and found that this only happens if I have my configuration set to Any CPU, which would execute in 64 bit in my case (Win7, 64bit). If I switch to x86, and enable break on any exception, I still get the exception, but the program continues without problems. My guess is that the exception ends up unhandled in x64 mode.

    Any Ideas?

    Regards,
    Karin
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Aug 2011 Link to this post

    Hi Karin,

     Thank you for contacting us.
    I tried to reproduce the problem you reported, but I couldn't. I'm attaching the problem I used. Please let me know if I'm missing something. If you could edit the project to make it reproduce the problem and send it back it would be of great help.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Karin
    Karin avatar
    8 posts
    Member since:
    Aug 2008

    Posted 02 Aug 2011 Link to this post

    The problem I described does not happen in your sample (but I don't exactly know why). If I change the code to the following snippet, it happens for the second window I open (click button to open window, close modal window (X on window), click button again, move / resize window -> crash):

    public MainWindow()
    {
        InitializeComponent();
     
        var testButton = new RadButton { Content = "Open" };
        var testWindow = new RadWindow { Content = testButton };
     
        testButton.Click += (s, a) =>
        {
            RadWindow window = new RadWindow() { Width = 500, Height = 500 };
            window.ShowDialog();
        };
     
        testWindow.ShowDialog();
    }

    Note that I failed to reproduce the problem on a (virtualized) Vista x64, but it did happen on a (virtualized) XP 32 bit as well as on another Win7, 64 bit machine. On my system it only happens if it executes in 64bit mode (I added a configuration for Any CPU in the sample you posted), as described in my first post.

    kind regards,
    Karin
  5. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Aug 2011 Link to this post

    Hello Karin,

     Thank you for reporting us this issue. We were able to observe and fix the problem. The fix will be included in the next internal build.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top