Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tCheckListBox ~ EOutOfResources

1 view
Skip to first unread message

Michael Beardmore

unread,
Apr 9, 2001, 8:00:19 PM4/9/01
to
Hi All,

I am using D5, Windows98, 64Mb RAM and loading items into a CheckListBox
using the Add method. I am reading the items from a stringlist
containing approx 50,000 strings then loading a subset of the strings
into the CheckListBox. In this particular case, the subset is all the
strings in the stringlist.
I am getting an EOutOfResources exception, which upon reading the help I
understand that I have run out of windows handles. I need to know if
there is any way of allocating more handles for my application i.e. is
there some setting in windows that allows the alocation of additional
handles. I have Freed as many of the objects in my app as I can and shut
down all other apps but the problem stems from the large number of
strings that I am manulipating.
Am I reduced to only ever reading in a subset of the strings from my
large stringlist.

Thanks, Michael.

Kurt Barthelmess (TeamB)

unread,
Apr 9, 2001, 10:55:32 PM4/9/01
to
Michael Beardmore wrote:

You want to create 50,000 check boxes? That's absurd. Who's going
to scroll through such nonsense? Be reasonable and limit it to <
100.

Good luck.

Kurt

Michael Beardmore

unread,
Apr 10, 2001, 12:54:26 AM4/10/01
to
Kurt,

Whether it is absurd or not I need to do it. To limit my app to 100
check boxes is absurd. The particular software I am working on supplies
historical financial data from CD-ROM giving my clients the option to
load in all securities (click on one button) or just a few (tick the
ones you want). Imagine giving clients the option of loading in historic
data for just IBM from all securities listed on the NYSE (where all
securities amount to a tad more than 100), all a client need do is
scroll through the list to IBM, tick it, then click on "Load". If you
have a more user friendly method of achieving this then please tell me.
I have only mentioned stocks because most people know what these are
however when you start looking at expired options to test option trading
strategies on historic data the number of securities increase
dramatically.
Hope this helps find a solution.

Martin Cremer

unread,
Apr 10, 2001, 4:43:49 AM4/10/01
to
Michael,

that seems to be an overkill.

I would no be able to find financial datas (historical or not) in a 50.000
Check - or Listbox. Not talking about an imposition for every user without
any search algorithm. Try dismember your problem into several groups
provided each group with a specific listbox or virtual listview.

Cheers

Martin Cremer


"Michael Beardmore" <mi...@justdata.com.au> schrieb im Newsbeitrag
news:3AD29201...@justdata.com.au...

Godwin Stewart

unread,
Apr 12, 2001, 7:57:46 AM4/12/01
to
"Michael Beardmore" <mi...@justdata.com.au> wrote in message
news:3AD29201...@justdata.com.au...

> Whether it is absurd or not I need to do it.

I'm afraid it *can't* be done on Windows 9x. Windows' 16-bit resource pool
means that the entire system is limited to approximately 16000 handles.

If you really need 50000 handles then your only solution is to use a real
32-bit operating system like NT or 2K pro - and *loads* of RAM in order to
avoid the system swapping as much as possible.

G. Stewart.

Peter Below (TeamB)

unread,
Apr 12, 2001, 3:27:25 PM4/12/01
to
In article <3AD24D13...@justdata.com.au>, Michael Beardmore wrote:
> I am using D5, Windows98, 64Mb RAM and loading items into a CheckListBox
> using the Add method. I am reading the items from a stringlist
> containing approx 50,000 strings then loading a subset of the strings
> into the CheckListBox. In this particular case, the subset is all the
> strings in the stringlist.
> I am getting an EOutOfResources exception, which upon reading the help I
> understand that I have run out of windows handles.

In this particular case you have been led astray. The TChecklistbox is an
owner-drawn listbox, it uses exactly one window handle, regardless on how
much strings you load into it. But on Win9x a listbox is limited to 16K
items (or 32K, don't remember exactly).

What you could do is use a TDrawGrid as display device. Drawing a checkbox
is easy using DrawFrameControl, drawing the text is even easier using the
drawgrids canvas in an OnDrawCell event. Of course you need some
off-screen data structure (e.g. a TStringlist) to hold the strings and the
check state for each (in the Tstringlist.Objects). Reacting to clicks on a
cell is also no problem (use the OnClick event, together with GetCursorPos
and Mousetocell).


Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

0 new messages