Hello,

I traced the bug to here:

function TIcsWndHandlerPool.GetWndHandler(
    HandlerCount : UINT;
    ThreadID     : THandle) : TIcsWndHandler;
var
    I : Integer;
    L : TIcsWndHandlerList;
begin
    // Search the list which has same thread ID
    I := FList.Count - 1;
    while (I >= 0) and
          (TIcsWndHandlerList(FList.Items[I]).ThreadID <> ThreadID) do
        Dec(I);
    if I >= 0 then
        L := TIcsWndHandlerList(FList.Items[I])
    else begin
        // No list found. Create a new one
        L          := TIcsWndHandlerList.Create;
        L.ThreadID := ThreadID;
        FList.Add(L);
    end;

    // Search the list for a WndHandler with enough MsgHandlers available
    I := 0;
    while I < L.Count do begin
        Result := TIcsWndHandler(L.Items[I]);
        if Result.GetMsgLeft >= HandlerCount then
            Exit;
        Inc(I);
    end;
    Result            := TIcsWndHandler.Create;
    Result.FOwnerList := L;
    OutputDebugString(PChar('TIcsWndHandler.Create OwnerList = ' + 
IntToHex(Integer(Result.FOwnerList), 8)));
    Result.MsgLow     := WM_USER + 1; // The EIP comes here, does not use my 
wndhandler in thread!
    L.Add(Result);
end;

This occurs in threadattach in the thread code I sent!

Best Regards,

SZ

----- Original Message ----- 
From: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Tuesday, February 06, 2007 10:17 PM
Subject: Re: [twsocket] Possible bug and solution in TWndControl


> Hi,
>
>> It is just a simple constant, why shouldn't it be 800 instead of 100??
>
> Because it is not the source of a bug. No need to change anything if it
> is not buggy. Changing it and then your code works does not prove there
> is a bug.
>
> ---
> Rgds, Wilfried [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> http://www.mestdagh.biz
>
> -- 
> 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