Hi mike ,
i want send a file for more device(phone or mobile) , i used thread for this but my program give me error 10060 , can u help me ?
i use BFBluetoothDiscovery and TBFObjectPushClient .
thread source :
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BFDiscovery, BFBase, BFClients, BFOBEXClient, BFObjectPushClient,
StdCtrls, Buttons;
type
TMT = class(TThread)
constructor Create(obj:TBFObjectPushClient);
protected
procedure Execute; override;
private
obj_push:TBFObjectPushClient;
public
end;
implementation
uses
unit1;
constructor TMT.Create(obj:TBFObjectPushClient);
begin
Self.obj_push:=obj;
inherited Create(false);
end;
procedure TMT.Execute;
begin
obj_push.Put('C:\Documents and Settings\Afr\Desktop\1.txt');
obj_push.Close;
end;
end.
//=========================================
procedure TForm1.Button1Click(Sender: TObject);
var i:Integer;
tm:Tmt;
Devices: TBFBluetoothDevices;
objp:TBFObjectPushClient;
begin
Devices := BFBluetoothDiscovery.Discovery(nil, False, False);
if Assigned(Devices) then begin
try
for i:=0 to Devices.Count-1 do
begin
objp:=TBFObjectPushClient.Create(self);
objp.BluetoothTransport.Device := Devices;
objp.Open;
Sleep(1000);
Application.ProcessMessages;
tm:=tmt.Create(objp);
end;
Caption:='aaaaa';
finally
Devices.Free;
end;
end;