Hi, i'm trying to figure out why i get this exception when i run a simple test GUI application, hope to receive some pointers. Thanks.
unit Unit1;
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, common;
type
{ TForm1 }
TForm1 = class(TForm)
mySMSSender: TWritePort;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
mySMSSender.sCFUN :='test'; <-- exception appears here!
end;
end.
unit common;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
TWritePort = class(TObject)
private
{ Private declarations }
protected
public
sCFUN: string;
constructor Create;
destructor Destroy; override;
end;
implementation
constructor TWritePort.Create;
begin
inherited Create;
end;
destructor TWritePort.Destroy;
begin
inherited;
end;
end.