Addin Expert - Notification Event Crashes Delphi - Please Help

This is a multi-part message in MIME format.

------=_NextPart_000_00A5_01BCFE9D.AB1DAAA0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

HI Folks,
=20
I have been trying to create a new Addin Expert which registers the =
TIAddInNotifier. All works ok, except that it crashes Delphi horribly =
when I exit Delphi. I was trying to use a Showmessage to show the status =
at various points, but that caused an GPF when changing projects.
=20
I have added the code I used here - Very simple and straight forward, I =
think. If anyone can see what I am doing wrong, please let me know. It =
would be much appreciated!

Thanks
=20
David Buch
email : seventh_dimens...@BigPond.com=20
=20

unit ProjectX;
interface
uses
  forms,Windows, Classes, ExptIntf, ToolIntf, unit1;=20
type
  TNotifier  =3D class(TIAddInNotifier)
    procedure FileNotification(NotifyCode: TFileNotification;
      const FileName: string; var Cancel: Boolean); Override;
    procedure EventNotification(NotifyCode: TEventNotification;
      var Cancel: Boolean); Override;
  End;=20

  TTimeKeeper =3D class(TIExpert)
  public
    function  GetName: String; override;
    function  GetIDString: string; Override;
    function  GetStyle: TExpertStyle; Override;
    constructor Create;
    destructor Destroy; Override;
  private
    TimeKeeperNMenuItem: TIMenuItemIntf;=20
    procedure TimeKeeperClick(Sender: TIMenuItemIntf);
  end;
Var
    Notifier : TNotifier;=20
Procedure OpenTimeKeeper;
procedure Register;
implementation

procedure Register;
begin
  RegisterLibraryExpert(TTimeKeeper.Create);
end;=20

procedure TNotifier.FileNotification(NotifyCode: TFileNotification;
      const FileName: string; var Cancel: Boolean);
Begin
  If NotifyCode =3D fnProjectOpening then
    Begin
      If not(Assigned(Form1)) then
        Form1 :=3D TForm1.create(application);
      Form1.info :=3D 'Opened Project - '+ Filename;
      Form1.show ;
    End;=20
End;
procedure TNotifier.EventNotification(NotifyCode: TEventNotification;
      var Cancel: Boolean);
begin
End;=20
function TTimeKeeper.GetIDString: String;
begin
  Result :=3D '7thDimension.ProjectX';
end;=20
function TTimeKeeper.GetStyle: TExpertStyle;
begin
  Result :=3D esAddin // Add-in expert
end;=20
function TTimeKeeper.GetName: String;
begin
  Result :=3D 'Project X'
end;=20

constructor TTimeKeeper.Create;
begin
  inherited Create;
  If assigned(ToolServices) then
    Begin
       Notifier :=3D tNotifier.Create;
       ToolServices.AddNotifier(Notifier);
    End;=20
end;
destructor TTimeKeeper.Destroy;
begin
    if assigned(Notifier) then
      begin
        ToolServices.RemoveNotifier(Notifier);
        Notifier.release;
      End;
    inherited Destroy;
end;=20
=20
end.

------=_NextPart_000_00A5_01BCFE9D.AB1DAAA0
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>HI Folks,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I have been trying to create a new =
Addin Expert=20
which registers the TIAddInNotifier. All works ok, except that it =
crashes Delphi=20
horribly when I exit Delphi. I was trying to use a Showmessage to show =
the=20
status at various points, but that caused an GPF when changing=20
projects.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I have added the code I used here - =
Very simple=20
and straight forward, I think. If anyone can see what I am doing wrong, =
please=20
let me know. It would be much appreciated!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Thanks</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>David Buch</FONT></DIV>
<DIV><FONT size=3D2>email : <A=20
href=3D"mailto:seventh_dimens...@BigPond.com">seventh_dimens...@BigPond.c=
om</A>=20
</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>unit ProjectX;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>interface</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>uses<BR>&nbsp; forms,Windows, =
Classes, ExptIntf,=20
ToolIntf, unit1;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>type<BR>&nbsp; TNotifier&nbsp; =3D=20
class(TIAddInNotifier)<BR>&nbsp;&nbsp;&nbsp; procedure=20
FileNotification(NotifyCode:=20
TFileNotification;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const FileName: =
string; var=20
Cancel: Boolean); Override;<BR>&nbsp;&nbsp;&nbsp; procedure=20
EventNotification(NotifyCode:=20
TEventNotification;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Cancel: =
Boolean);=20
Override;<BR>&nbsp; End;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2><BR>&nbsp; TTimeKeeper =3D=20
class(TIExpert)<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; function&nbsp; =
GetName:=20
String; override;<BR>&nbsp;&nbsp;&nbsp; function&nbsp; GetIDString: =
string;=20
Override;<BR>&nbsp;&nbsp;&nbsp; function&nbsp; GetStyle: TExpertStyle;=20
Override;<BR>&nbsp;&nbsp;&nbsp; constructor =
Create;<BR>&nbsp;&nbsp;&nbsp;=20
destructor Destroy; Override;<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp;=20
TimeKeeperNMenuItem: TIMenuItemIntf;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp; procedure=20
TimeKeeperClick(Sender: TIMenuItemIntf);</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp; end;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>Var<BR>&nbsp;&nbsp;&nbsp; Notifier : =

TNotifier;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Procedure =
OpenTimeKeeper;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>procedure Register;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>implementation</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><BR>procedure =
Register;<BR>begin<BR>&nbsp;=20
RegisterLibraryExpert(TTimeKeeper.Create);<BR>end;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2><BR>procedure=20
TNotifier.FileNotification(NotifyCode:=20
TFileNotification;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const FileName: =
string; var=20
Cancel: Boolean);<BR>Begin<BR>&nbsp; If NotifyCode =3D fnProjectOpening=20
then<BR>&nbsp;&nbsp;&nbsp; Begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If=20
not(Assigned(Form1)) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Form1 :=3D=20
TForm1.create(application);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form1.info =
:=3D=20
'Opened Project - '+ Filename;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Form1.show=20
;<BR>&nbsp;&nbsp;&nbsp; End;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>End;<BR>procedure=20
TNotifier.EventNotification(NotifyCode:=20
TEventNotification;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Cancel:=20
Boolean);<BR>begin<BR>End;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>function TTimeKeeper.GetIDString:=20
String;<BR>begin<BR>&nbsp; Result :=3D=20
'7thDimension.ProjectX';<BR>end;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>function TTimeKeeper.GetStyle:=20
TExpertStyle;<BR>begin<BR>&nbsp; Result :=3D esAddin // Add-in=20
expert<BR>end;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>function TTimeKeeper.GetName:=20
String;<BR>begin<BR>&nbsp; Result :=3D 'Project =
X'<BR>end;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2><BR>constructor=20
TTimeKeeper.Create;<BR>begin<BR>&nbsp; inherited Create;<BR>&nbsp; If=20
assigned(ToolServices) then<BR>&nbsp;&nbsp;&nbsp;=20
Begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notifier :=3D=20
tNotifier.Create;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ToolServices.AddNotifier(Notifier);<BR>&nbsp;&nbsp;&nbsp;=20
End;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>end;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>destructor=20
TTimeKeeper.Destroy;<BR>begin<BR>&nbsp;&nbsp;&nbsp; if =
assigned(Notifier)=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ToolServices.RemoveNotifier(Notifier);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
Notifier.release;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
End;<BR>&nbsp;&nbsp;&nbsp;=20
inherited Destroy;<BR>end;</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 =
size=3D2>end.</FONT></DIV></DIV></DIV></BODY></HTML>

------=_NextPart_000_00A5_01BCFE9D.AB1DAAA0--