Re: [twsocket] ICS Message handlers

2010-08-18 Thread Anton S.
Eric, talking about your shared timer: do you call OnTimer of all attached objects directly or post WM_TIMER to them? I had though over the same timer class and that was my idea to broadcast timer signal. I think it'll eliminate the issue of blocking during loop since PostMessage is

Re: [twsocket] ICS Message handlers

2010-08-18 Thread Eric Fleming Bonilha
Hi Anton, I call it directly, in order not to allocate handlers, if you create a class with a handle and post a message to it, it will be the same as using TTimer directly, because you will use as many resources as TTimer would use (1 handle per instance), unless you create a class that is

[twsocket] Suggestion for improvement

2010-08-18 Thread Eric Fleming Bonilha
Hello I would suggest the changing of constant WH_MAX_MSG in OverbyteIcsWndControl.pas to a global variable to which we can change on our software, without changing ICS code. Doing this will allow us to control the amount of shared resources per handle, giving the ability to create more

Re: [twsocket] ICS Wnd Control - Possible bug

2010-08-18 Thread Arno Garrels
Eric, I guess it helps to remove all pending messages with the given ID from the queue when the message ID is unregistered. One could do that either in custom code or maybe it should be added in TIcsWndHandler.UnregisterMessage as below? procedure TIcsWndHandler.UnregisterMessage(var Msg:

Re: [twsocket] ICS Wnd Control - Possible bug

2010-08-18 Thread Eric Fleming Bonilha
HI Arno True, I think that will help, I will add this line to my ICS code to check if it works, but I believe that it will work I also think that this is something that must be on ICS code, on UnregisterMessage as you proposed, not custom code. I will test and come back to you soon Eric

Re: [twsocket] ICS Wnd Control - Possible bug

2010-08-18 Thread Eric Fleming Bonilha
Msg := 0; while PeekMessage(LMsg, FHandle, Msg, Msg, PM_REMOVE) do {loop}; // == added if FMsgCnt = 0 then DeallocateHWnd; end; Just a little correction while PeekMessage(LMsg, FHandle, Msg, Msg, PM_REMOVE) do {loop}; // == added Msg := 0; Or else you will pass 0 to

Re: [twsocket] ICS Wnd Control - Possible bug

2010-08-18 Thread Arno Garrels
Arno Garrels wrote: Eric, I guess it helps to remove all pending messages with the given ID from the queue when the message ID is unregistered. One could do that either in custom code or maybe it should be added in TIcsWndHandler.UnregisterMessage as below? Previous code did remove

Re: [twsocket] Suggestion for improvement

2010-08-18 Thread Arno Garrels
Eric Fleming Bonilha wrote: I would suggest the changing of constant WH_MAX_MSG in OverbyteIcsWndControl.pas to a global variable to which we can change on our software, without changing ICS code. That won't work since TIcsWndHandler declares a static array with length WH_MAX_MSG. Instead I

Re: [twsocket] Suggestion for improvement

2010-08-18 Thread Eric Fleming Bonilha
That won't work since TIcsWndHandler declares a static array with length WH_MAX_MSG. Instead I suggest that TIcsWndHandlerPool gets a public, thread-safe method which checks whether the value can be changed and would raise an exception if not. This method would succeed only if the pool was empty