Arno,

There is a TWndControl in the worker thread context which is created before 
clients are threadattach'ed to the thread (in a custom message handler).

Regards,

SZ

----- Original Message ----- 
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, February 05, 2007 5:57 PM
Subject: Re: [twsocket] Possible bug and solution in TWndControl


> Fastream Technologies wrote:
>> Yoiu also missed that this is a service application thread with no
>> other component than ICS! Even no GUI. I am unable to find the bug--
>> there is one I know but it happens under heavy load and does not show
>> its ugly head under Debug compilation.
>>
>> It is just a simple constant, why shouldn't it be 800 instead of 100??
>
> You can, but I fear it doesn't _solve the problem finally.
>
> If you set property MsgLow like:
>
> WSocket1 := TWSocket.Create(something);
> WSocket1.MsgLow := WM_APP + 100;
>
> strange things will happen, including AVs in
> TIcsWndHandler.UnregisterMessage. Because some message numbers
> are already assigned with default numbers (base WM_USER) before the
> new value of property MsgLow will be set.
>
> Instead initialize global variable GWndHandlerMsgLow in an
> Initialization section in project unit.
>
> initialization
>    GWndHandlerMsgLow := WM_APP + 100;
>
> I hope this helps.
>
> ---
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
>
>
>> Regards,
>>
>> SZ
>>
>> ----- Original Message -----
>> From: "Arno Garrels" <[EMAIL PROTECTED]>
>> To: "ICS support mailing" <twsocket@elists.org>
>> Sent: Monday, February 05, 2007 3:47 PM
>> Subject: Re: [twsocket] Possible bug and solution in TWndControl
>>
>>
>>> Fastream Technologies wrote:
>>>> Yes these are all what I thought for a week time! I call GetMessage,
>>>> then check for known/my messages. If none of them, call
>>>> dispatchmessage and all works fine except the problem which goes
>>>> away if we set the WHG_MAX to 800 instead of 100! Now there is no
>>>> such exception thrown--tested with millions of connections.
>>>
>>> Ahh, I missed that you use WM_APP + 100, that's a range I would not
>>> use for window messages but something in the higher range of WM_USER
>>> instead.
>>>
>>> It's strange anyway that increasing the maximum number of messages
>>> made the error went away since that shouldn't change the base number
>>> and range.
>>>
>>> However here is a quick text-search in my component folder
>>>
>>> VirtualTreeview:
>>> WM_CHANGESTATE = WM_APP + 32;
>>>
>>>
>>> VShellTools:
>>> WM_NEWINPUT = WM_APP + 111;
>>> WM_SHELLNOTIFY = WM_APP + 51; // Change in the Shell occured
>>> WM_REMOVEBUTTON = WM_APP + 8; // VirtualShellToolbar
>>> WM_CHANGENOTIFY_CUSTOM = WM_APP + 9;
>>> WM_UPDATESCROLLBAR = WM_APP + 10;
>>> WM_VETBASE = WM_APP + 100
>>>
>>> and more..
>>> So be carefull and find the sender!!
>>>
>>> ---
>>> Arno Garrels [TeamICS]
>>> http://www.overbyte.be/eng/overbyte/teamics.html
>>>
>>>
>>>
>>>
>>>>
>>>> Francois, will you?
>>>>
>>>> Best Regards,
>>>>
>>>> SZ
>>>>
>>>> ----- Original Message -----
>>>> From: "Arno Garrels" <[EMAIL PROTECTED]>
>>>> To: "ICS support mailing" <twsocket@elists.org>
>>>> Sent: Monday, February 05, 2007 1:50 PM
>>>> Subject: Re: [twsocket] Possible bug and solution in TWndControl
>>>>
>>>>
>>>>>>> This is probably because you post custom messages do you?
>>>>>>
>>>>>> Yes but they are starting from WM_USER and there are only 4 of
>>>>>> them in this thread. According to help, WM_USER starts from
>>>>>> 0x0800 and there should be enough room until WM_APP+100.
>>>>>
>>>>> But there must somebody send messages in that range.
>>>>>
>>>>> At first check whether you send any message to the hidden component
>>>>> window that has not been registered thru a call to
>>>>> WndHandler.AllocateMsgHandler().
>>>>>
>>>>> Also, you can (should) use your own message pump in a thread, that
>>>>> checks the HWND.
>>>>>
>>>>> if msg.hwnd = 0 then { Thread message }
>>>>> begin
>>>>>  Any message that was posted to this thread goes here.
>>>>>  In this case you may even PostThreadMessages with message numbers
>>>>>  in the range of ICS messages.
>>>>> end
>>>>> else
>>>>>  Not a thread message, receiver is a window
>>>>>
>>>>> ---
>>>>> Arno Garrels [TeamICS]
>>>>> http://www.overbyte.be/eng/overbyte/teamics.html
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Fastream Technologies wrote:
>>>>>> Hello Arno,
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> From: "Arno Garrels" <[EMAIL PROTECTED]>
>>>>>> To: "ICS support mailing" <twsocket@elists.org>
>>>>>> Sent: Monday, February 05, 2007 1:24 PM
>>>>>> Subject: Re: [twsocket] Possible bug and solution in TWndControl
>>>>>>
>>>>>>
>>>>>>> Fastream Technologies wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> When I use the following thread code:
>>>>>>>>
>>>>>>>> void __fastcall ReverseProxyClientThread::Execute()
>>>>>>>> {
>>>>>>>>  //---- Place thread code here ----
>>>>>>>>  FreeOnTerminate = true;
>>>>>>>>
>>>>>>>> ...
>>>>>>>>
>>>>>>>>  TIcsWndHandler *windowHandler = new TIcsWndHandler();
>>>>>>>>  windowHandler->MsgLow = WM_APP + 100;
>>>>>>>>
>>>>>>>>  while(!Terminated)
>>>>>>>>   messagePump();
>>>>>>>>
>>>>>>>>  delete windowHandler;
>>>>>>>> }
>>>>>>>>
>>>>>>>> sometimes we get "Test exception" exception. We have up to 32
>>>>>>>> THttpConnection and 32 THttpCli descendents in this thread.
>>>>>>>> When I raised WHG_MAX to 800, the exception disappears.
>>>>>>>> Francois, could you raise the constant?
>>>>>>>
>>>>>>> This is probably because you post custom messages do you?
>>>>>>
>>>>>> Yes but they are starting from WM_USER and there are only 4 of
>>>>>> them in this thread. According to help, WM_USER starts from
>>>>>> 0x0800 and there should be enough room until WM_APP+100.
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> SZ
>>>>> --
>>>>> To unsubscribe or change your settings for TWSocket mailing list
>>>>> please goto http://www.elists.org/mailman/listinfo/twsocket
>>>>> Visit our website at http://www.overbyte.be
>>> --
>>> To unsubscribe or change your settings for TWSocket mailing list
>>> please goto http://www.elists.org/mailman/listinfo/twsocket
>>> Visit our website at http://www.overbyte.be
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to