outlook raising exception when running adxtoys addin

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

outlook raising exception when running adxtoys addin
 
Phillippe Allen




Posts: 30
Joined: 2005-11-07
I was having issues with a test addin in outlook, namely outlook would raise various exceptions when closing and then hang. So I have unregistered it and removed it from outlooks toolbar, then installed the adxtoys2 addin. When I select any email, click any of the ADXToys2 buttons a dialog box appears (appropriate to the button clicked). However, when that dialog box closes, it fires off an exception "ADX Toys OL 2 error: the add-in has fired an exception. Access violation at address....." and then outlook hangs (requires task manager to kill the process).
For example, if I click on the "About ADX Toys" button, an about box pops up. Clicking the OK button will generate the access violation.

I m running Outlook 2000 SP-3 (9.0.0.6627) on winXP SP2

Is there something I could be changing with my setup to get this working properly?

Regards
Phil
Posted 28 Nov, 2005 18:06:24 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Phillippe,

This problem is a well known "issue" in Outlook 2000. I thought we had fixed it, but it turned out to be fixed only in the Easy MAPI version of this toys. I have just fixed and upload a new version. Could you please try to test it again and let me know about the results.

Posted 29 Nov, 2005 06:58:33 Top
Phillippe Allen




Posts: 30
Joined: 2005-11-07
ADXToys works fine now thanks.

Unfortuantely my addin appears to still be causing Outlook to generate exceptions when outlook closes down. At least, no exceptions occur when user does not click on my addin controls but they do occur if user has clicked on them.

are you able to tell me what sort of "gotchas" I need to keep an eye out for to avoid this occurring?

eg i am using some legacy code which creates various data modules. If the code has not destroyed these data modules but is relying upon windows to do the cleanup (Not the way i would have chosen to do it), could this be causing this problem? Note that the addin supports Word and Excel as well, but it is not causing any problems with them.

Regards
Phil
Posted 29 Nov, 2005 18:24:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Phillippe,

In our ADXToys example I have added the code below. Try the same in your add-in.


uses Windows, Forms;

procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
begin
  [B]Application.Handle := GetActiveWindow;[/B]
  //...
end;

procedure TAddInModule.adxCOMAddInModuleAddInFinalize(Sender: TObject);
begin
  //...
  [B]Application.Handle := 0;[/B]
end;

Posted 30 Nov, 2005 07:13:37 Top
Phillippe Allen




Posts: 30
Joined: 2005-11-07
Dmitry

thanks for that. Unfortunately I am still getting some exceptions being raised when Outlook is closed down :-(

The problem appears to be related in some way to some legacy code which connects to a SQL server database and sets up various data modules.

This is particularly confusing considering that I am experiencing no problems with this Addin in Word or Excel.

Would you have any suggestions as to things I could try or things I should avoid?
Posted 30 Nov, 2005 14:47:42 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Phillippe,

I can't say anything for certain right now because I didn't see your code. Let's try to investigate the issue.

Does it happen in Outlook 2000 only? Do you use the OnCreate, OnDestroy and other _standard_ events of TAddInModule? Can you send me your project (or some test project with the same behavior) for testing?


Posted 01 Dec, 2005 07:10:30 Top