BrowserPane.Control is throwing an exception in .Net8 Addin

BrowserPane.Control is throwing an exception in .Net8 Addin

esalvaJSAU5
Participant Participant
394 Views
3 Replies
Message 1 of 4

BrowserPane.Control is throwing an exception in .Net8 Addin

esalvaJSAU5
Participant
Participant

I created a custom addin project, This addin has a Test button in the ribbon.

 

The button click event will add a new BrowserPane to the active document. Im using AddByManifest to load the un managed active x control. 

 

During the execution of AddByManifest() the temporary MessageBox in the FormLoad event will shown, which makes me think that the control is loaded properly.

 

But when i try to access the BrowsePane.Control property, It is throwing an exception.


Does anyone have an idea on how to fix this problem ? 

I attached the CustomAddin that i created.

 

Thank you

 

esalvaJSAU5_0-1725946590809.png

 

0 Likes
Accepted solutions (1)
395 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor
Accepted solution

I looked into your code and I don't understand why you need to use BrowserPane when the requested content is derived from Windows.Forms.UserControl.

Isn't it better to use DockableWindow? C# sample is available for example here on my GitHub

Method BrowserPanes.AddByManifest is designed for placing ActiveX objects which is not your case in my opinion.

0 Likes
Message 3 of 4

esalvaJSAU5
Participant
Participant

.

0 Likes
Message 4 of 4

esalvaJSAU5
Participant
Participant

Thanks for your reply. It works now. Thank you so much. 

0 Likes