OptionsPage close event?

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

OptionsPage close event?
 
Hansjoerg Posch




Posts: 3
Joined: 2006-07-12
Hello!

I want to write some values to the registry when an OptionsPage is closed ... which event is the right one?

I tried to use OnDestroy but it does not work (event is never fired). OnCreate for loading the properties works properly.

Best regards,

Hansjoerg Posch
Posted 14 Jul, 2006 04:38:07 Top
Dmitry Kostochko


Add-in Express team


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

I would recommend writing registry data in the Apply method. This method is called by Outlook when user clicks the OK or Apply buttons.


function TOptionsPage.Apply: HResult;
begin
  [B]// TODO - put your code here[/B]
  FDirty := False;
  Result := S_OK;
end;
Posted 14 Jul, 2006 07:34:38 Top
Hansjoerg Posch




Posts: 3
Joined: 2006-07-12
Dmitry,

I have done that and my code now looks like:

function TOptionPage.Apply: HResult;
begin
Showmessage('apply');
// call save settings
SaveSettings;

FDirty := False;
Result := S_OK;
end;

The event isn't fired, although.

Best regards,

Hansjoerg Posch
Posted 14 Jul, 2006 09:28:22 Top
Dmitry Kostochko


Add-in Express team


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

Do you call the GetPropertyPageSite and UpdatePropertyPageSite methods in event handlers of your controls?

Posted 14 Jul, 2006 11:10:15 Top
Trevor Pegley




Posts: 22
Joined: 2006-12-11
Hi Dmitry

What is the recommended method for this in the latest version of ADX? I can't find the methods you mention.

Thanks

Trev
Posted 23 Feb, 2007 17:36:18 Top
Dmitry Kostochko


Add-in Express team


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

What is the recommended method for this in the latest version of ADX?


The latest Add-in Express version has no changes in the Outlook options page implementation, so the method is the same - using the Apply method.

I can't find the methods you mention.


Please see the <YOUR_OPTION_PAGE_CLASS>.Apply method.

Posted 26 Feb, 2007 05:59:59 Top
Trevor Pegley




Posts: 22
Joined: 2006-12-11
Thanks,

I found this example that is very useful:

http://www.add-in-express.com/projects/adx-ol-option-page-params.zip

T
Posted 27 Feb, 2007 03:57:48 Top