Solved

Bug? EReadError, Glyphs, multiple OSes, D1, D2, D3

Posted on 1998-02-18
11
548 Views
Last Modified: 2013-12-03
I recently developed a multimedia application that used the TBitButton for all my buttons on a Delphi 1.0 application. The intent was to have the program run under Win3.X. I now have an Error that reads
"Exception EReadError in module CDMASTER.EXE at xxxxxx
Error reading play.Glyph.Data: Out of System Resources"

I have surfed the WWW for information on what is causing this error and have found that no one seems to know. I have seen references to this error on two other shareware product WWW pages and have seen numerous posts to various
"Delphi" newsgroups that show other persons are having these same problem. This error seems to appear on any Delphi product under any operating system; However, this error is sometimes reported to be a small percentage of people. In my program, it happens to every Win3.X user.

Perhaps someone has solved this problem? Perhaps someone would be kind enough to post some workarounds or solutions for this problem. If you think you know the problem, add a comment... This problem is big enough that any little bit will help.

Perhaps it is a bug that has gone unfixed in all versions?


Note: I will not grade a question until I have verfied the fix.

Looking forward to a great discussion!
John Zitterkopf
0
Comment
Question by:zitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1359597
dear zitt,

We have discussed the out of system resources problem in a previous problem with 'oris' This means the FREE handles of the system are about to be exausted. I wrote here what I have suggested. By using less handles he can be able to solve the problem.

Causes
------
EOutofResources error is reported by the Windows whenever a handle is to be created or new class is to be registered to the system. Any handle creation function (DC, menu,window-form) returns 0 and Delphi interpret this as a OutofResources error.
By my opinion this is not correct, or one step more is needed to understand the actual error.The delphi should call GetLastError, but it does not.
When I search this error in VCL source code I found that it is in the following units: Graphics, Forms, Menus.

Limits
------
Windows 95 is limitted to 16384 handles per object class, i.e. this much of menu or window locks up the system. However Windows NT does not have a restriction on number of handles (It said to be so). And as far as I know for win3.1 the limit is 65536 system wide.

Suggestions
-----------
Asside from the other friends suggestions I have the following:
1 - If you are creating several TCanvas, TPen, TBrush, TMetafile etc.(in general memory consuming GDI objects), be sure to call Free for them.
2 - As a rule of thumb do not precreate more than 20 such resources on FormCreate.
3 - Remember that out of resources error is cummulative. i.e. it may not appear at the begining; by forgetting to release handles the system resources may be used up gradualy.
4 - If you sure that you free the handles allocated by your program (manualy by calling constructors of TCanvas, TPen etc), try to maintain the list of handles manualy created by
program and FREE them ALL in ExitProc or finalization section. Because when your program terminated erronously some of the Free methods may not be called
5 - If you are making use of large bitmaps just for painting the background of forms etc. Create bitmap, paint it and release it if you are not doing time critical painting (animation).

What do you think friend?

Igor
0
 

Author Comment

by:zitt
ID: 1359598
Igor,

Thanks for your comments. Good ones, however, my error isn't EOutofResources it's EReadError. The error occurs when the forms are being created, not during normal execution of the program.
I'm not manually creating any resources, only using TBitButtons.

John
0
 
LVL 5

Expert Comment

by:inter
ID: 1359599
Yes, however, if the error (if we examine the source -delphi 1.0 client server-) the error is realated with windows handles. By thinking of Win31, the possible cause can be

- There may not be either enough ! FILE HANDLES !
  or ! GDI HANDLES !

Could I express myself friend,
please comment
Igor
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:ZifNab
ID: 1359600
Have you compiled the RES file with BRCC (for 16 bit!) or with BRCC32 (for 32 bit)
0
 

Author Comment

by:zitt
ID: 1359601
Inter,

Ah... yes, good point. I'll suggest filehandles as a possible fix.

ZifNab,
The .RES files were generated with ImageEditor that comes with Delphi 1.0.

John
0
 

Author Comment

by:zitt
ID: 1359602
Found the problem...

Turns out that some of the glyphs I had loaded in my TBitBtns were truecolor (24bit) BMPs. It turns out that Delphi/Win3.x cannot handle 24bit BMPs unless the video resolution is capable of displaying 24bit graphics.

I'm happy I found the problem with the help Synature. Now... If I can just recover the 2mths I spent attempting to fix the problem.

Inter... I'll give you the points for the question since you put the most time into it... just give a quick answer and I'll give you a grade.

John
0
 
LVL 5

Accepted Solution

by:
inter earned 300 total points
ID: 1359603
Dear zitt,

You may lower the points and spend less if you want, because I can not find the answer! So please do what you want, I am ok.

Thanks
Igor
0
 

Author Comment

by:zitt
ID: 1359604
You cannot lower points for a question only raise. I tried 8)

I hope this helps other persons!
0
 
LVL 5

Expert Comment

by:inter
ID: 1359605
Dear zitt

308 is realy much, tell me something and I cooperate with you, a custom component? a component modification or enhancement? anything? Please just tell...

Sincerely
Igor
0
 

Author Comment

by:zitt
ID: 1359606
Igor,

Really, it's OK. As long as someone benfits from my 2mth struggle with this bug, I think 308 points is worth it.

As far a componets, I have one that could be modified... but I'm not sure it's an easy mod... (If it were, I'd have already done it).
Whatever the case, Just enjoy the points... they were free to me... now they're free for you.
0
 
LVL 5

Expert Comment

by:inter
ID: 1359607

I got it. Thanks.

Igor
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question