>My app uses TWSocket (TSmtpCli) inside TThreads.
>I create 25 TSmtpCli's per TThread. All TSmtpCli instances created inside
TThread Execute. 
>TStmpCli->MultiThreaded set to true. My TThreads have message loops.
>With 5000 SmtpCli's (inside 200 TThreads) I got exception:
>"Unable to create TIcsWndControl hidden window. Error 1158"
>How I can use 4-5K of TSmtpClis in my app ?
>P.s: ICS v7, C++Builder 2007 with all updates, my app uses FastMM and

Error 1158 is "ERROR_NO_MORE_USER_HANDLES: The current process has used all
of its system allowance of handles for Window Manager objects"

You have to reduce the number of handles your application is using, or split
the application into several collaborating separate processes. 
You may also add more memory in Windows because this is a limiting factor.
Running on a Windows Server also helps. It has more resources than a Windows
Workstation version.

Windows has several limits on various types of handles. There is a limit of
10K handles for window handles but ICS-V7 share a single handle between a
lot of TWSockets. Try creating more TSmtpCli per thread.

See this:

Are you sure that your application is not leaking handles ?

Embarcadero MVP

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

Reply via email to