Tools API: Modifying project options?

Hi,

how do I programmatically modify the options associated with a
project via the Tools API?

My initial attempt to flush to disk, modify on disk and then
making Delphi re-read the updated settings unfortunately was not
successful:

procedure TCompileNotifier.EventNotification(NotifyCode:
TEventNotification;
      var Cancel: Boolean);
...
begin
...
  ToolServices.SaveProject; { flush *.RES, *.DPR, *.DOF }

  case NotifyCode of

  enBeforeCompile:

  begin
    Prj := ChangeFileExt(ToolServices.GetProjectName, '.DOF');
    with TIniFile.Create(Prj) do
    try
     if ReadInteger('Linker', 'MapFile', 0) <> 3 then
     begin
       WriteInteger('Linker', 'MapFile', 3);
       { flush INI file }
       WritePrivateProfileString(nil, nil, nil, PChar(Prj));

       { this does not convince Delphi to update the settings }
       ToolServices.ReloadFile(ChangeFileExt(Prj, '.DOF'));
       ToolServices.ReloadFile(ChangeFileExt(Prj, '.DPR'));
     end;

Is there any "clean" procedure other than compiling the project
with the commandline compiler using "updated" settings (in
DCC32.CFG)?

[Ray, I am very much looking forward to the new book...]
--
Stefan.Hoffmeis...@UNI-Passau.DE
http://kakadu.rz.uni-passau.de/~w4hoff01/
University of Passau, Bavaria, Germany