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

EOutOfResources

14 views
Skip to first unread message

Dumboo

unread,
Jul 11, 2003, 5:41:58 AM7/11/03
to
hi there

I have created a graphics Application which uses lots of BMP's and JPEG's
after playing the Application for while i gt 'EOutOfResources' Exception i
went throught the VCL help files, but was unable to find any solutions for
it :-(

Suggesttions ???

-Dumboo


Remy Lebeau (TeamB)

unread,
Jul 11, 2003, 1:49:19 PM7/11/03
to

"Dumboo" <dum...@nowhere.com> wrote in message
news:3f0e...@newsgroups.borland.com...

> I have created a graphics Application which uses lots of
> BMP's and JPEG's after playing the Application for while
> i gt 'EOutOfResources' Exception

You're probably trying to have too many bitmaps and jpgs and such allocated
at the same time. The OS only has a finite amount of resources available
for use. Which OS are you using in the first place? How many bitmaps/jpgs
are you actually allocating?


Gambit


Junk Mail

unread,
Jul 11, 2003, 4:22:28 PM7/11/03
to
When allocating new objects the memory associated with those objects is
placed on the heap. If you have the available ram and hard drive space for
virtual memory then the problem can be solved by going to

project->Options
Select the Linker Tab
Change the Max Heap Size to something larger than it currently is.

Get back to me on this one curious if this fixes your problem.

If this doesn't fix your problem you may have some code that keeps
reallocating the memory but never frees the memory.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003


Remy Lebeau (TeamB)

unread,
Jul 11, 2003, 5:32:23 PM7/11/03
to

"Junk Mail" <Junk...@GlobalWideCommunications.com> wrote in message
news:3f0f...@newsgroups.borland.com...

> When allocating new objects the memory associated
> with those objects is placed on the heap.

EOutOfResources is not related to the heap. That would have been throwing
EOutOfMemory instead. EOutOfResources deals with GDI objects (Pens,
Brushes, Canvas, etc), Window handles, etc. instead.


Gambit


Dumboo

unread,
Jul 11, 2003, 11:53:54 PM7/11/03
to
Thanks guys for your suggestions.......I gt the solution for it, its little
weired.....but maybe its my fault, or maybe i was not able to follow the VCL
properly, any way do correct me and give me appropriate suggestions

i m just giving the brief(somewhat exact) outline of what i was doing, and
what solution i applied, kindly advise me and give me your suggestions. :-)

in my application i m using one class, 'abc' , its having one TBitmap object
tmpBMP

class abc
{
protected:
int bmpCounter;

public:
Graphics::TBitmap *tmpBMP;
abc();
~abc();

// this will be calles from the Timer
void Draw(void);

// we will be assigning it the Address of Forms canvas(FormCanvas =
Form->Canvas)
TCanvas *FormCanvas;
};

abc::abc()
{
bmpCounter = 0;
tmpBMP = new Graphics::TBitmap;
}

abc::~abc()
{
delete tmpBMP;
}

void abc::Draw(void)
{
tmpBMP->LoadFromResourceName((int)HInstance, "ImgSeq" +
IntToStr(bmpCounter));
bmpCounter ++;
bmpCounter % = 20;
FormCanvas->Draw(0, 0, tmpBMP);
}
//------------------ ABOVE CLASS WAS GIVING PROBLEM -------------------//

without much thinking i just assumed that the resource part is giving
problem(dont know y, maybe bacause the exception was
EOutOfResources.....instinct)


Then i restructured this calss to

class abc
{
protected:
int bmpCounter;

public:
abc();

// this will be calles from the Timer
void Draw(void);

// we will be assigning it the Address of Forms canvas(FormCanvas =
Form->Canvas)
TCanvas *FormCanvas;
};

abc::abc()
{
bmpCounter = 0;
}

void abc::Draw(void)
{
// instead of having tmpBMP as memer of class i made it local variable
// of the function itself

Graphics::TBitmap *tmpBMP = new Graphics::TBitmap;

tmpBMP->LoadFromResourceName((int)HInstance, "ImgSeq" +
IntToStr(bmpCounter));
bmpCounter ++;
bmpCounter % = 20;
FormCanvas->Draw(0, 0, tmpBMP);

delete tmpBMP;
}

AND It worked, I tried to simulate the activity with Timer, but it is not
giving Problem even when it runs for Hours Dont know y it happened :-/

maybe becuase i was loading the images from the resources again and again in
the same bitmap.....maybe....dont know why....:-/

Want some suggestion....what was actually hapenning earlier and what
happened next ..... ???

once again am i doing this correct way...it there more efficient and better
way ???

Thanks

-Dumboo :-/


0 new messages