After Office update 1808 my AdxOlForm is just white, but uses the same space as before

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

After Office update 1808 my AdxOlForm is just white, but uses the same space as before
 
petgre




Posts: 48
Joined: 2014-04-29
Hi

Before Office 365 version 1808 we naver had any problems with our search form in the calendar. In Outlook.
VB code, VS2017 version 15.9.9

After the update of Office, it seems like the form is shown, because it occupies the space, but the form is just white.
Like it is somewhere outside the outlook region.

The form has been working for several years and in a lot of office versions, without any code changes.

In the AdxOlFormsCollection I can se it has
ExplorerLayout = DockRight
ExplorerItemTypes = olAppointmentItem
InspectorLayout = RightSubpane
AlwaysShowHeader = True
Enabled = True

I updated to the last version of add in express 9.2.4635
Created a new version, distribute it to all the users.
I tought the problem was solved, but today I talked to a person having my latest version. The form did not display, it was white again.

We disabled my add in, then enabled it again, now it works.

Is there anything I can do to control the form and display it correctly?


Cheers! //Peter
Posted 28 Mar, 2019 09:01:38 Top
Alexander Solomenko




Posts: 140
Joined: 2009-02-27
Hi Petgre,

We suppose the issue relates to multi-DPI support. It looks like the DPI context of the Outlook window is different from the DPI context of the pane itself.

You can try to bypass this issue in this way. Override the CreateHandle() method of the ADXOlForm class. Before you call base.CreateHandle(), you should 1) call GetWindowDpiAwarenessContext() passing it this.HostHandle which contains the handle of the Outlook window, and 2) call SetThreadDpiAwarenessContext passing it the result of the previous call.

These Windows API functions are described at https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getwindowdpiawarenesscontext and https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setthreaddpiawarenesscontext. Note that they were introduced in Windows 10, version 1607.
Regards,
Aleksandr Solomenko
Posted 28 Mar, 2019 10:16:38 Top
petgre




Posts: 48
Joined: 2014-04-29
Thanks for quick reply!

To be honest, I dont have any CreateHandle() method in the whole project. At least as I can figure out.

This add in was created 2014, if it has anything to do with it..?`

Programming in VB, not C.

I have a :
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub

//Peter
Posted 29 Mar, 2019 03:46:11 Top
Alexander Solomenko




Posts: 140
Joined: 2009-02-27
Hi Petgre,

You may not have this method but it is available in the base class System.Windows.Forms.Form from which your ADXOlForm class is inherited. It is virtual and can be overridden. Just add it to your class as following:

Protected Overrides Sub CreateHandle()
    MyBase.CreateHandle()
End Sub
Regards,
Aleksandr Solomenko
Posted 29 Mar, 2019 04:02:03 Top