How to show WPF on left reading pane

Add-in Express™ Support Service
That's what is more important than anything else

How to show WPF on left reading pane
 
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
Project Name = "Project"
WPF Form Namespaces Name = "Project.Forms"
WPF Form Name = "WPFForm"

I created an WPF Form. I opened AddinModules in design view of the file. I added the TaskPanes property of the Properties menu as in the picture.

User added an image

I get the following error when opening Outlook.

Application Domain: C:\source\repos\PROJ\Project\bin\Debug\
Assembly Codebase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
Assembly Full Name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Assembly Version: 4.0.0.0

Exception Source:
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Unable to create specified ActiveX control.
Exception Target Site: ForwardCallToInvokeMember

---- Stack Trace ----
System.RuntimeType.ForwardCallToInvokeMember(memberName As String, flags As BindingFlags, target As Object, aWrapperTypes As Int32[], msgData As MessageData&)
mscorlib.dll: N 0193 (0xC1) IL
AddinExpress.MSO.ICTPFactory.CreateCTP(CTPAxID As String, CTPTitle As String, CTPParentWindow As Object)
mscorlib.dll: N 00000 (0x0) JIT
AddinExpress.MSO.ADXAddinModule.AddCustomTaskPanes(parent As Object, outlookFolderName As String, showError As Boolean)
mscorlib.dll: N 0653 (0x28D) IL
Posted 20 Jan, 2020 06:30:05 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
Hello Nevzat,

The Custom Task Panes technology requires that the type specified in the ADXTaskPane.ControlProgId property is System.Windows.Forms.UserControl.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jan, 2020 06:42:21 Top
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
The same error continues. Do you have a document or page to view the WPF form?
Posted 20 Jan, 2020 08:00:55 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
Start with showing a System.Windows.Forms.UserControl (#1). Add a WPF UserControl (#2) to your project (see the Add New Item dialog) and populate it with controls. Build the project. Then put a System.Windows.Forms.Integration.ElementHost control (a container for WPF controls) on #1 and specify that the ElementHost shows #2. The ElementHost control is available on the Toolbox in Visual Studio.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Jan, 2020 08:43:04 Top
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
I showed the WPF form by adding the ElementHost control to the Outlook form. Is it the correct use this way?
Posted 22 Jan, 2020 06:11:37 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
I assume, it works. If so, yes, this is correct.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Jan, 2020 06:38:03 Top
Nevzat Hayri TAVUK?U




Posts: 30
Joined: 2019-12-19
Thanks Andrei.
Posted 23 Jan, 2020 06:23:37 Top
Andrei Smolin


Add-in Express team


Posts: 19138
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jan, 2020 06:26:55 Top