C
cwzcwz
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TClientClass = class
IDUDPS: TIdUDPServer;
procedure IDUDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
public
constructor Create;
destructor Destroy; override;
end;
constructor TClientClass.Create;
begin
inherited;
IdUDPS := TIdUDPServer.Create(nil);
IdUDPS.OnUDPRead := IDUDPRead; //如果不放这句,执行正常.
IdUDPS.Active := True;
end;
procedure TClientClass.IDUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
begin
//
end;
View Source:
function Client_Initialize: Boolean;
begin
if FClient = nil then
begin
FClient := TClientClass.Create;
Result := True;
end
else
begin
Result := False;
end;
end;
exports
Client_Initialize;
主程序是一个C++的exe,用动态调用的方式,如果不加IdUDPS.OnUDPRead := IDUDPRead;
这句,一切正常,如果加了这句,F9后无法断到下的断点,并且执行出错.
TClientClass = class
IDUDPS: TIdUDPServer;
procedure IDUDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
public
constructor Create;
destructor Destroy; override;
end;
constructor TClientClass.Create;
begin
inherited;
IdUDPS := TIdUDPServer.Create(nil);
IdUDPS.OnUDPRead := IDUDPRead; //如果不放这句,执行正常.
IdUDPS.Active := True;
end;
procedure TClientClass.IDUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
begin
//
end;
View Source:
function Client_Initialize: Boolean;
begin
if FClient = nil then
begin
FClient := TClientClass.Create;
Result := True;
end
else
begin
Result := False;
end;
end;
exports
Client_Initialize;
主程序是一个C++的exe,用动态调用的方式,如果不加IdUDPS.OnUDPRead := IDUDPRead;
这句,一切正常,如果加了这句,F9后无法断到下的断点,并且执行出错.