I'm programing one network application in delphi 6 using TTCPServer. At OnAccept event of this component I call showmodal for another form. This cause to hang the main form. I think that it is because of threads but I do not know how to showmodal the form at this event. I really have to call that. I appreciate any answer. thanks.
var
s: array[0..10000] of byte;
i, j: integer;
Str : String;
Request, UN, Pass: WideString;
StartItemNode : IXMLNode;
st: TStringStream;
begin
CoInitialize(nil);
i := ClientSocket.ReceiveBuf(s, 10000, 0);
Str := '';
for j := 0 to i - 1 do
Str := Str + AnsiChar(s[j]);
XMLDoc.XML.Text := Str;
XMLDoc.Active := true;
StartItemNode := XMLDoc.ChildNodes.FindNode('r');
Request := StartItemNode.ChildNodes['request'].Text;
if(Request = 'Order')then
begin
Memo1.Lines.Text := Str;
ClientSocket.Sendln('<?xml version="1.0" encoding="utf-8"?><r><answer result="OK"></answer></r>');
**Form2.ShowModal;**
end;