Hi all:
I have imported a library of a software to delphi7 , I have got a file which called WINFIOLLib_TLB.pas.which contain a procedure and interface .
in order to comunicate to that sofware I have found this code on the net but it doesen't work properly .
the first fault I got is ':' expected but '=' found on TForm1 = class(TForm).
NB: all fault code are summurized bellow:
[Error] Unit1.pas(25): Undeclared identifier: 'TWinFIOL_Application'
[Error] Unit1.pas(33): ';' expected but '.' found
[Error] Unit1.pas(33): '=' expected but ')' found
[Error] Unit1.pas(33): '=' expected but ';' found
[Error] Unit1.pas(34): Expression expected but 'BEGIN' found
[Error] Unit1.pas(35): Undeclared identifier: 'Event'
[Error] Unit1.pas(37): Statement expected but 'PROCEDURE' found
[Error] Unit1.pas(39): Undeclared identifier: 'IWFChannel'
[Error] Unit1.pas(40): Constant or type identifier expected
what is the wrong on this code ?
thanks for your help and suggestions
I have imported a library of a software to delphi7 , I have got a file which called WINFIOLLib_TLB.pas.which contain a procedure and interface .
in order to comunicate to that sofware I have found this code on the net but it doesen't work properly .
the first fault I got is ':' expected but '=' found on TForm1 = class(TForm).
Code:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TWFEvent = class (TInterfacedObject, IWFEvent)
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormDblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure Notify(event: SYSINT; const text: WideString); safecall;
end;
var
Form1: TForm1;
WinFIOL_Application1: TWinFIOL_Application;
implementation
{$R *.dfm}
procedure TWFEvent.Notify(event: SYSINT; const text: WideString); safecall;
begin;
Form1.Memo1.Lines.Add(IntToStr (Event));
Form1.Memo1.Lines.Add(String (Text));
procedure TForm1.FormDblClick(Sender: TObject);
Var
Ch: IWFChannel;
Event: TWFEvent;
begin
Ch := WinFiol_Application1.GetChannelPointer(WinFiol_Application1.GetCurrentChannel);
WinFiol_Application1.GetCurrentChannel <> 0
Event := TWFEvent.Create; //
EMask := WFEVENTMASK_ALL; //
Ch.Advise(Channel.Event, EMask);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
WinFIOL_Application1 := TWinFIOL_Application.Create(self);
end;
procedure TForm1.Button1Click(Sender: TObject);
Var
Chn_Name: String;
New_Ch: Integer;
begin
OpenDialog1.InitialDir := 'C:\Program Files\Element Management\ChnFiles';
If OpenDialog1.Execute Then Chn_Name := OpenDialog1.FileName Else Exit;
WinFIOL_Application1.OpenChannelFile(Chn_Name, 0, New_Ch);
WinFiol_Application1.GetChannelPointer(New_Ch).SetReadBuffer(512, 4);
end;
end.
NB: all fault code are summurized bellow:
[Error] Unit1.pas(25): Undeclared identifier: 'TWinFIOL_Application'
[Error] Unit1.pas(33): ';' expected but '.' found
[Error] Unit1.pas(33): '=' expected but ')' found
[Error] Unit1.pas(33): '=' expected but ';' found
[Error] Unit1.pas(34): Expression expected but 'BEGIN' found
[Error] Unit1.pas(35): Undeclared identifier: 'Event'
[Error] Unit1.pas(37): Statement expected but 'PROCEDURE' found
[Error] Unit1.pas(39): Undeclared identifier: 'IWFChannel'
[Error] Unit1.pas(40): Constant or type identifier expected
what is the wrong on this code ?
thanks for your help and suggestions