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

Is this possible ?

0 views
Skip to first unread message

Rafal PL

unread,
Sep 23, 2000, 3:00:00 AM9/23/00
to
Hi,

Is it possible to check from code if there are enough resources
to create an object ? Or should I use exception handlings
as the only way to do this ?

Regards,
Rafal


Dirk Claessens

unread,
Sep 24, 2000, 3:00:00 AM9/24/00
to
Rafal PL <pla...@chimera.ae.krakow.pl> schreef in berichtnieuws
8qhrsn$rqq$1...@news.tpi.pl...

> Hi,
>
> Is it possible to check from code if there are enough resources
> to create an object ?

Not really, no.

Or should I use exception handlings
> as the only way to do this ?

Yes and no. If your app is designed well, this situation shouldn't occur.
The most likely cause is to have 25 autocreated forms, each containing 100
edit fields & combo boxes or some such.
This is asking for trouble. The remedy is to create/free forms on the fly as
needed.

--
Regards,

Dirk Claessens
---------------------------------------------------------
http://www.claessens16.yucom.be
Attention: All spamshields raised; E-mails will bounce!
---------------------------------------------------------

Rafal PL

unread,
Sep 24, 2000, 3:00:00 AM9/24/00
to
Hi,

> > Is it possible to check from code if there are enough resources
> > to create an object ?
>
> Not really, no.

This clears up a little.

> Yes and no. If your app is designed well, this situation shouldn't
occur.
> The most likely cause is to have 25 autocreated forms, each
containing 100
> edit fields & combo boxes or some such.
> This is asking for trouble. The remedy is to create/free forms on
the fly as
> needed.

I don't mean components. I've got an application that can open
multiple
files. For each file I have to create an object that handle it. Now
wonder
what will happen if a user tries to open 100 or more files at once ? I
have
to have some protection. I've only thought that there is a way to
check
whether objects can be created or not.

Regards,
Rafal


J.T. Wenting

unread,
Sep 24, 2000, 3:00:00 AM9/24/00
to

> I don't mean components. I've got an application that can open
> multiple
> files. For each file I have to create an object that handle it. Now
> wonder
> what will happen if a user tries to open 100 or more files at once ? I
> have
> to have some protection. I've only thought that there is a way to
> check
> whether objects can be created or not.
>
in that case exception handling would be the way to go (or allocate the
required memory by hand and check the result of that, like you would do with
malloc() in C).

0 new messages