[fpc-pascal]Acces violation????
boci
irixhu at externet.hu
Tue Jan 9 21:02:27 CET 2001
I create a unit. It use the ssockets unit. I copied (but another name)
from the fcl. I compile it, and want to use, but the program give this
output:
something happened
An unhandled exception occurred at 0x080680B9 :
Access violation
0x080680B9
0x0807214C
0x0804847F
0x0804846C
0x00000000
And the unit:
unit Cow_Server;
interface
{$MODE objfpc}
uses
ssockets;
type
CowServer=class(TObject)
private
CS:TInetServer;
public
constructor Create(Port:longint);
destructor Destroy;override;
procedure OnConnect(Sender:TObject;Data:TSocketStream);
procedure Start;
procedure Stop;
end;
implementation
constructor CowServer.Create(Port:longint);
begin
CS:=TInetServer.Create(Port);
CS.OnConnect:=@OnConnect;
end;
destructor CowServer.Destroy;
begin
CS.Free;
end;
procedure CowServer.OnConnect(Sender:TObject;Data:TSocketStream);
begin
writeln('Connected');
end;
procedure CowServer.Start;
begin
CS.StartAccepting;
end;
procedure CowServer.Stop;
begin
CS.StopAccepting;
end;
end.
I don't know, what is the problem.
PLease Help!
Cow.
More information about the fpc-pascal
mailing list