Doesn't terminate when outlook closed

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

Doesn't terminate when outlook closed
When outlook is closed, outllook process remains running. 
Jeff Gallant


Guest


Hi

I have an Outlook add-in, written in Delphi 2010, running in Outlook 2002. I noticed that, in the IDE, the add-in is still running after outlook is closed (I have to use "program reset" from the "run" menu to stop it). More importantly, Outlook still appears as a running process in task manager even though it is no longer visible.

I've tried commenting out virtually all of my code, but to no avail.

I have an adxOlExplorerCommandBar component with 3 adxCommandBarButtons (1 enabled and 2 disabled) defined and an adxOlInspectorCommandBar with 1 adxCommandBarButton.

If you run but don't click the button, it terminates fine but if you click the button, even though everything is commented out and so it doesn't do anything, it doesn't.

What should I be looking at to solve this?

Best wishes

Jeff
Posted 15 Nov, 2011 03:18:33 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hi Jeff,

I understand you as follows. You have an add-in containing an adxOlExplorerCommandBar with a couple of buttons. There're no event hadlers in your add-in other than empty event procedures for the Click events of these buttons. And the add-in makes Outlook hang if you click any of these button. Is this a correct description of the issue?

I'd like to know what Add-in Express build are you using. And what is the Outlook build number?


Andrei Smolin
Add-in Express Team Leader
Posted 15 Nov, 2011 03:27:27 Top
Jeff Gallant


Guest


Hi Andrei

The outlook build is 2002 (10.2627.3501) SP-1

The Add-in Express build is v605-b0759

In the interface section, I have

"type
TcoCWfromOutlook = class(TadxAddin, IcoCWfromOutlook)
end;

TAddInModule = class(TadxCOMAddInModule)
adxOlExplorerCommandBar1: TadxOlExplorerCommandBar;
adxCWitem: TadxOlInspectorCommandBar;
procedure adxOlExplorerCommandBar1Controls0Click(Sender: TObject);
procedure adxCOMAddInModuleAddInInitialize(Sender: TObject);
procedure adxCOMAddInModuleOLExplorerFolderSwitch(Sender: TObject);
procedure adxCOMAddInModuleOLExplorerSelectionChange(Sender: TObject);
procedure adxOlExplorerCommandBar1Controls1Click(Sender: TObject);
procedure adxCWitemControls0Click(Sender: TObject);
procedure adxCOMAddInModuleAddInFinalize(Sender: TObject);
private
bCWopened : boolean;
bFirstTimeActivate : boolean;
bLoggedIn : boolean;

procedure XsetupCFLCaseworker;

protected
public
end;

var
adxCWfromOutlookClass : TAddInModule;"

All of the code in the methods is commented out except

"procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
begin
adxCWfromOutlookClass := Self;
// bLoggedIn:=False;
// bFirstTimeActivate:=true;
end;

X
procedure TAddInModule.adxCOMAddInModuleAddInFinalize(Sender: TObject);
begin
adxCWfromOutlookClass := nil;
end;"

I also have at the end of the code

"initialization
TadxFactory.Create(ComServer, TcoCWfromOutlook, CLASS_coCWfromOutlook, TAddInModule);"

I have imported a lot of code from another program so that I can search and write to a database but none of the objects are being created because I've commented out the call to do that from the _IMPL module.

Best wishes

Jeff
Posted 15 Nov, 2011 03:44:27 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
I have Outlook 2002 (10.6856.6858) SP3. I suggest that you install the latest service pack for Office 2002.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Nov, 2011 03:54:33 Top
Jeff Gallant


Guest


Hi Andrei

Have spoken to my IT Department. They say that we will all be upgrading to Office 2010 soon. I can get upgraded next week so I'll wait til then and see if the problem goes away.

If not, I'll get back onto the forum.

Thanks for your help.

Best wishes

Jeff
Posted 15 Nov, 2011 04:41:28 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Jeff,

I would like to test this myself: the earlier we know whether the issue is a bug or not, the better. Can you send me your project to the support email address, find it {Add-in Express installation folder}\readme.txt. And make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Nov, 2011 04:47:00 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hi Jeff,

Thank you very much for sending me the project. In your code, I found this line:

Outlook := TOutlookApplication.Create(nil);

An Outlook add-in doesn?Â?Ð?ét create new Outlook.Application objects, it uses the Outlook.Application object provided in the OutlookApp property of the add-in module.

Please let me know if fixing this also fixes the original issue.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Nov, 2011 06:52:01 Top
Jeff Gallant


Guest


Hi Andrei

Thanks for that but, unfortunately, that's not it.

I commented out that line and the declaration of the variable "Outlook" and it made no difference (and also the original plugin I was having the problem with didn't have have that line at all).

Best wishes

Jeff

(Regards from London (GMT))
Posted 16 Nov, 2011 07:31:28 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hi Jeff,

I cannot reproduce the issue using your code on Outlook 2002 SP3.

I suggest that you set every Outlook-related variable declared in your code to nil at the end of the corresponding procedure.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Nov, 2011 02:03:56 Top