Jason Coley
Posts: 272
Joined: 2005-05-26
|
This is a major bug a few of my customers have complained of this and I have finally been able to reproduce on my system which has Outlook 2003 sp1 installed with all updates. I compiled using Delphi 2005 Update 3.
The OLE error comes up when trying to the set the visible property of my controls. It seems to happen after opening and closing the contact inspectors a few times. This happens with the following code that I use on the OLNewInspector procedure.
OutlookContactStandard.Controls.Items[0].Visible := bolProd1Loaded;
OutlookContactStandard.Controls.Items[1].Visible := bolProd1Loaded;
OutlookContactStandard.Controls.Items[2].Visible := bolProd2Loaded;
OutlookContactStandard.Controls.Items[3].Visible := bolProd2Loaded;
procedure TadxCommandBarControl.SetVisible(const Value: WordBool);
begin
if FVisible <> Value then FVisible := Value;
try
if Assigned(DefaultInterface) then
** if DefaultInterface.Visible <> Value then
DefaultInterface.Set_Visible(Value);
Changed;
except
on E: SysUtils.Exception do CommandBar.Owner.DoError(E);
end;
end; |
|
Jason Coley
Posts: 272
Joined: 2005-05-26
|
and actually after running the addin through the debugger I also get an error in the following procedure.
procedure TadxEventSink.Disconnect;
begin
try
if Assigned(FIControl) then begin
if FIControl.GetType in [adxButton, adxAdvancedControl] then
InterfaceDisconnect(FIControl.DefaultInterface, DIID__CommandBarButtonEvents, FCookie)
else
InterfaceDisconnect(FIControl.DefaultInterface, DIID__CommandBarComboBoxEvents, FCookie);
end;
if Assigned(FIBuiltInControl) then begin
if FIBuiltInControl.DefaultInterface.Type_ = msoControlButton then
InterfaceDisconnect(FIBuiltInControl.DefaultInterface, DIID__CommandBarButtonEvents, FCookie)
else
InterfaceDisconnect(FIBuiltInControl.DefaultInterface, DIID__CommandBarComboBoxEvents, FCookie);
end;
except
// Outlook 2000 bug
end;
end;
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2880
Joined: 2004-04-05
|
Hi Jason,
Try to move your code that changes Visible to the OnOLInspectorActivate event handler instead of OnOLNewInspector.
Please don't publish Add-in Express source code on the forum. If you need to point to a particular place of the source code, do this via email.
|
|
Jason Coley
Posts: 272
Joined: 2005-05-26
|
that may have fixed the issue, I will test some more and get back to you tomorrow.
Jason |
|