[Lazarus] Problems: TDBGrid under WinCE
Usuario Anónimo
usuarioanonimomysql at gmail.com
Wed Oct 1 02:20:51 CEST 2008
I can´t fill the buffer, SendMessage never returns 0. Why?
My code:
procedure TForm1.Button1Click(Sender: TObject);
var
Buffer: string;
Sent: integer;
begin
Buffer := 'START—…—END'; // –> 1198469 characters
Sent := LTCPComponent1.SendMessage(Buffer,LTCPComponent1.Iterator);
if Sent = 0 then
ShowMessage('Buffer full')
else
ShowMessage(IntToStr(Sent)); // –> Show 1198469
end;
Best regards!
2008/9/29 Aleš Katona <almindor at gmail.com>
> Dňa Ne, 2008-09-28 o 20:14 +0200, Usuario Anónimo napísal:
> > I get an asyncronous socket error.
> >
> > This is my code.
> >
> > procedure TForm1.Button1Click(Sender: TObject);
> > var
> > Item: string;
> > begin
> > System.Assign(DataModule1.ItemFile,'items.txt');
> > System.Reset(DataModule1.ItemFile);
> > repeat
> > System.Read(DataModule1.ItemFile,Item);
> >
> >
> DataModule1.LTCPComponent1.SendMessage(Item,DataModule1.LTCPComponent1.Iterator);
> > until EOF(DataModule1.ItemFile);
> > System.Close(DataModule1.ItemFile);
> > end;
> >
> > Why?
>
> You need to check if .Send or .SendMessage in your case don't return 0.
> If so either an error on the network occurred (reported by OnError
> event), or the OS send buffer is full and you need to use the OnCanSend
> event. For more info on sending big data see:
> http://lnet.wordpress.com/usage/sockets-protocols-and-sending/
>
> Btw. is DataModule now working properly in Lazarus? Last I tried it's
> things weren't visible in the OI on other units of the project.
>
> Ales
> > _______________________________________________
> > Lazarus mailing list
> > Lazarus at lazarus.freepascal.org
> > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080929/9942bd92/attachment-0007.html>
More information about the Lazarus
mailing list