Jump to content

Baxing

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Hello FPiette, I have posted a new thread in the Intraweb forum. And there are many members who have replied to the topic. If you are interested, you can read it in this link. For now, I am not able to implement ICS on IntreWeb, I am currently working on a way to implement an Indy TCP socket on IntraWeb for WebSocket Client(I have a sample code from this link) but still use ICS for a WebSecket Server. And if you have any suggestions to be able to using ICS on IntraWeb please tell me. Thank you
  2. Hello FPiette, OK, Thank you very much for the suggestion and good feedback on my problem.
  3. I show you for coding from your sample in my IntraWeb application unit Unit1; interface uses Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, IWCompMemo, Vcl.Controls, IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompButton, Winapi.Windows, Winapi.Messages; type TIWForm1 = class(TIWAppForm) BTNCreateHwnd: TIWButton; BTNPostMessage: TIWButton; BTNDestroyHwnd: TIWButton; MMO1: TIWMemo; procedure BTNCreateHwndAsyncClick(Sender: TObject; EventParams: TStringList); procedure BTNDestroyHwndAsyncClick(Sender: TObject; EventParams: TStringList); procedure BTNPostMessageAsyncClick(Sender: TObject; EventParams: TStringList); private FWinHandle : HWND; procedure WndProc(var Msg: TMessage); public constructor Create(AOwner : TComponent); override; end; implementation {$R *.dfm} { TIWForm1 } procedure TIWForm1.BTNCreateHwndAsyncClick(Sender: TObject; EventParams: TStringList); begin if FWinHandle <> INVALID_HANDLE_VALUE then begin System.Classes.DeallocateHWnd(FWinHandle); FWinHandle := INVALID_HANDLE_VALUE; mmo1.Lines.Add('Window handle destroyed') end; FWinHandle := System.Classes.AllocateHwnd(WndProc); if FWinHandle = INVALID_HANDLE_VALUE then mmo1.Lines.Add('Error creating window handle') else mmo1.Lines.Add(Format('Window handle create %d', [FWinHandle])); end; procedure TIWForm1.BTNDestroyHwndAsyncClick(Sender: TObject; EventParams: TStringList); begin if FWinHandle = INVALID_HANDLE_VALUE then mmo1.Lines.Add('Window handle not created yet') else begin System.Classes.DeallocateHWnd(FWinHandle); FWinHandle := INVALID_HANDLE_VALUE; mmo1.Lines.Add('Window handle destroyed') end; end; procedure TIWForm1.BTNPostMessageAsyncClick(Sender: TObject; EventParams: TStringList); begin if FWinHandle = INVALID_HANDLE_VALUE then mmo1.Lines.Add('Window handle not created') else if not PostMessage(FWinHandle, WM_USER, 1234, 5678) then // mmo1.Lines.Add('PostMessage failed'); // mmo1.Lines.Add(Format('PostMessage failed with error %d', [GetLastError])); mmo1.Lines.Add(Format('PostMessage failed with error %d (HWND=%d)', [GetLastError, FWinHandle])); end; constructor TIWForm1.Create(AOwner: TComponent); begin inherited; FWinHandle := INVALID_HANDLE_VALUE; end; procedure TIWForm1.WndProc(var Msg: TMessage); begin mmo1.Lines.Add(Format('MSG=%d', [Msg.Msg])); end; initialization TIWForm1.SetAsMainForm; end. And this is result to show GetLastError, FWinHandle (click CreateHwnd and then click PostMessage buttons) Thank you
  4. This Error code : PostMessage failed with error 1400
  5. Hello FPiette, This is result of you sample code on VCL Application when press Create Hwnd and Post Message button and IntraWeb Application when press Create Hwnd and Post Message button
  6. Hello, Chris Rutkow, FPiette I've changed that setting port and addr but still having the same problem. (Invalid argument (#10022 in WSAAsyncSelect) I found that if I put the connection code to event OnFormShow, it will be able to connected the server normally. But can not be used on event AsyncClick of any control, which in use is required on this event. Thanks
  7. I can't do it, Please give me a sample code for VCL and I will try it in the IntraWeb app.
  8. Now, I using IntraWeb version 15.2.37 on Delphi 10.3.3 (and using ICS Version 8.68)
  9. I'll try to test it according to your suggestion. and try to send data from server to specified cleint.
  10. I want to send data between multi client and server privately with TCP for some specific work. In the beginning I tested via localhost as the first step. Before putting the server part on the real server and in production I will use SSL as well. I think using TWSocket(TSslWSocket) for Client (on Delphi Intrraweb App.) and TWSocketServer(TSslWSocketServer) for Server (on VCL) is the answer. How to use message pump? Is there a usage example to suggest me? or Using TICsIpStrmLog can do as I want please tell me. I've just used the ICS for the first time and tested it on VCL from the available samples and enough to be quite as I want. But encountered a problem when using it with IntraWeb. Please help guide me again.
  11. Hello, I have tested connecting to Web Socker Server with Component TWSocket on Delphi IntraWeb Application. But an error occurred as attached picture. The command for connecting to Socket server is used within the TIWButton's OnAsyncClick event with the following commands: with sktClient do begin Proto := 'tcp'; Port := 'localhost'; Addr := 'telnet'; LineMode := True; LineEnd := #13#10; Connect; end which this command can be used normally on VCL.. Please guide me for use ICS Sockets components normally on Delphi IntraWeb. Because now I can't connect and send/receive any data if using ICS Sockets components on Delphi IntraWeb application. Thanks
×