none
How to debug PowerPoint 2016 bug and provide useful information to Microsoft? RRS feed

  • Question

  • I could not find a specific forum for PowerPoint 2016, so maybe this issue needs to be moved?

    Anyway, we have developed an add-in for PowerPoint 2013/2016 and seems like we found an issue in Windows 10 with PowerPoint 2016.

    The add-in is an ActiveX control that loads a WPF application, which besides the usual WPF controls has a WindowsFormHost with a custom control that displays a 3D viewer.

    In this particular case when we start the presentation mode and use the embedded application in a slide, the WPF controls show fine, but the custom 3D control is not there.

    The only exception that we get is "System.InvalidOperationException: Hosted HWND must be a child window of the specified parent." etc... and the stack trace is all Microsoft code, nothing from our side or other third party libraries.

    Is it possible somehow to collect more information about what is causing the particular issue in this version of Windows/PowerPoint in order to provide a more detailed bug report to Microsoft?

    Thursday, August 17, 2017 10:06 AM

All replies

  • The full stack trace is:
    System.InvalidOperationException: Hosted HWND must be a child window of the specified parent.
       at System.Windows.Interop.HwndHost.BuildWindow(HandleRef hwndParent)
       at System.Windows.Interop.HwndHost.BuildOrReparentWindow()
       at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
       at System.Windows.PresentationSource.OnVisualAncestorChanged(DependencyObject uie, AncestorChangedEventArgs e)
       at System.Windows.UIElement.OnVisualAncestorChanged(Object sender, AncestorChangedEventArgs e)
       at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
       at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
       at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
       at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
       at System.Windows.Media.Visual.AddVisualChild(Visual child)
       at System.Windows.FrameworkElement.set_TemplateChild(UIElement value)
       at System.Windows.Controls.ContentPresenter.UseContentTemplate.BuildVisualTree(FrameworkElement container)
       at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
       at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    Thursday, August 17, 2017 11:08 AM
  • Hi Georgios Petrou,

    the error occurs because you cannot add custom 3d control to the powerpoint slide.

    or it is not supported by powerpoint.

    I don't have much information regarding your custom control so I can't say what the specific issue.

    I suggest you to first check your WPF application and verify that your custom control displaying properly in that.

    and if then also you are getting the same error then I suggest you to find work around for this issue.

    if you are displaying the control within your WPF application then I suggest you to post the question on WPF forum and try to check the suggestion given by them.

    you had mentioned that,"Is it possible somehow to collect more information about what is causing the particular issue in this version of Windows/PowerPoint in order to provide a more detailed bug report to Microsoft?"

    at present , I think that the issue is related with code and it is not a bug. we can say it a bug if it is working in one version and generating error in other version.

    Reference:

    InvalidOpeartionExcetion: Hosted HWND must be a child window of the specified parent

    Regards

    Deepak


    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.


    Friday, August 18, 2017 1:56 AM
    Moderator
  • Hi Deepak,

    first of all everything works fine in PowerPoint 2013, so this is not a problem with our control.

    Second of all, the problem is not only with our control.

    Just create an ActiveX control in PowerPoint, show a WPF window to it and in that window use a WindowsFormsHost with any kind of WinForms control.

    You will see that in this case (Windows 10, PowerPoint 2016 from 365 Office) is not displayed.

    This is definitely a Microsoft bug and your developers should know about it.

    Please forward this to them.

    Friday, August 18, 2017 6:37 AM
  • Hi Georgios Petrou,

    first of all , I suggest you to make test on multiple machines.

    the issue can be caused with the particular version of Powerpoint 2016 or caused by any windows update.

    so you can come to know about whether it can be reproduce by all the versions of Powerpoint 2016 or not.

    you can also try to create a sample project that can reproduce the issue and share here.

    so that we can make a test with it to verify the same also you can get some suggestions from community members.

    it is also possible that something got changed between Powerpoint 2013 and powerpoint 2016 cause this issue.

    if it is a bug then you can try to submit your feedback to Powerpoint User voice.

    Welcome to PowerPoint's Suggestion Box!

    but first I suggest you to share the code for verification.

    Regards

    Deepak


    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.


    Friday, August 18, 2017 9:36 AM
    Moderator