This is a migrated thread and some comments may be shown as answers.

Error HRESULT E_FAIL has been returned from a call to a COM component

1 Answer 77 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
satish
Top achievements
Rank 1
satish asked on 05 Sep 2010, 07:45 AM
hi
i created a custom control in silverlight
when i added the control to  richtextbox , it raised an error

System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.Collection_RemoveValue[T](PresentationFrameworkCollection`1 collection, CValue value)
   at MS.Internal.XcpImports.Collection_RemoveDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
   at System.Windows.PresentationFrameworkCollection`1.RemoveDependencyObject(DependencyObject value)
   at System.Windows.Controls.UIElementCollection.RemoveInternal(UIElement value)
   at System.Windows.PresentationFrameworkCollection`1.Remove(T value)
   at Telerik.Windows.Documents.UI.UILayer.AddChild(UIElement uiElement)
   at Telerik.Windows.Documents.UI.UIInlinesLayer.UpdateUI()
   at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort)
   at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort, UIElementPool uiElementPool)
   at Telerik.Windows.Documents.UI.DocumentPresenterBase.UpdateUILayersViewPortSize(RectangleF viewPort)
   at Telerik.Windows.Documents.UI.DocumentPresenterBase.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)}

can some one please help me how to fix this

the code is :

Telerik.Windows.Documents.Model.

 

InlineUIContainer container = new Telerik.Windows.Documents.Model.InlineUIContainer();

 

container.UiElement = PlaceHolder;

Telerik.Windows.Documents.Model.

 

 

Section section = new Telerik.Windows.Documents.Model.Section();

 

Telerik.Windows.Documents.Model.

 

 

Paragraph paragraph = new Telerik.Windows.Documents.Model.Paragraph();

 

paragraph.Inlines.Add(container);

section.Paragraphs.Add(paragraph);

 

 

 

RadDocument document = new RadDocument();

 

document.Sections.Add(section);

MsWordExampleInstance.editor.Document = document;

 


thanks

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 08 Sep 2010, 03:10 PM
Hello Satish,
One problem I see in your code is that you did not specify width and height of  InlineUIContainer - in its constructor or trough Width and Height properties, so you can try do this at first place. If this do not help, please send us sample project that reproduces the problem so we could be more useful.

Kind regards,
Boby
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
satish
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or