Common Page produces error when first displayed

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

Common Page produces error when first displayed
PageType displays error 
logikonline




Posts: 35
Joined: 2006-04-14
When I set the MicrosoftOutlook PageType in the main properties for the add-in - the first time it loads, an error is fired by AddIn which I can not capture. All subsequent loading of the property window works fine. It is the page that appears under the Tools > Options

Below is the exact message.

CommonPage error: the add-in has fired an exception. Object reference not set to an instance of an object.

Assembly Codebase: file:///C:/WINDOWS/assembly/GAC/AddinExpress.MSO/3.5.1872.2003__c20c070a1fc9a144/AddinExpress.MSO.dll
Assembly Full Name: AddinExpress.MSO, Version=3.5.1872.2003, Culture=neutral, PublicKeyToken=c20c070a1fc9a144
Assembly Version: 3.5.1872.2003
Assembly Build Date: 2/15/2005 1:06:46 AM

Exception Source:
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
Exception Target Site: Object reference not set to an instance of an object.
Posted 25 Jun, 2007 20:55:50 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Dave.

Did you add any code to the property page constructor? Do you get the issue on the development PC?



P.S. We always do our best to answer your forum requests as soon as possible. However, we apply the rule "first in first out" with Premium Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found
Posted 26 Jun, 2007 13:49:20 Top
logikonline




Posts: 35
Joined: 2006-04-14
I have tried on 4 machines - all the same error (it occurs only on the first loading the property window and appears 3 times in a row - 3 dialog boxes then opens the property window fine). I did not test this prior to other issues previously. It appears only on what I call the common page - Property Page located under Tools > Options and appears when I select options prior to moving to "my" tab. It does not happen on any of the other property pages... and have included all the code references below.

Me.AddinName = "Contact Outlook"
Me.Description = "Provides connection between eActivated Portal Framework and Microsoft Outlook"
Me.FolderPages.Add(Me.pgeCalendar)
Me.FolderPages.Add(Me.pgeContact)
Me.FolderPages.Add(Me.pgeTask)
Me.FolderPages.Add(Me.pgeMail)
Me.Images = Me.ImageList1
Me.Namespace = "ContactOutlook"
Me.PageTitle = "eActivated"
Me.PageType = "ContactOutlook.CommonPage"
Me.RegisterForAllUsers = True
Me.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaOutlook


Nothing is in the CommonPage constructore - it simply shows a couple of textboxes which access GetSettings (7 statements) in the load - but are wrapped in Try-Catch statements.

for example: GetSetting("eActivated", "ContactManager", "Contact-Create", False)

regards,
Dave

p.s. I just upgraded to the new version and the error is still present.
Posted 27 Jun, 2007 12:22:14 Top
logikonline




Posts: 35
Joined: 2006-04-14
I found the bug - and I believe it would be something you should resolve on your side but you can decide - let me explain more.

When the property window loads - it is common for developers to place GetSettings code in the Load portion of the form for the property page to restore settings placed in the registry.

The error occurs when the code is setting properties of controls, like dropdowns, checkboxes and textboxes. Since I place a function call to OnStatusChange() when a value changes - apparently when the property page is loading it causes the Add-In to report an eror which can not be captured.

I resolved this by placing a boolean IsLoading - and escaped the function call until after the Load function is done.

p.s. It doesn't happen with all controls - so I have to assume it does not trigger the onchange event for every control when setting value.

regards,
Dave
Posted 27 Jun, 2007 16:32:53 Top
logikonline




Posts: 35
Joined: 2006-04-14
I narrowed it down to controls which have a setting set in design time -

for example

textbox.text = "2"

Causes the Add-In to throw the error when first launched
Posted 27 Jun, 2007 17:02:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Dave.

Thank you for the notification.
Posted 28 Jun, 2007 09:47:56 Top