?
Solved

loadpicture() function fails, out of memory.

Posted on 1997-06-20
6
Medium Priority
?
314 Views
Last Modified: 2010-05-18
I am writing a VB5 program where I load image controls at run time, and seem to be running out of memory. The application will load about 20 image controls, then it just locks up. If I try to load another VB application I get a bunch of "out of memory" errors. However, I have 24 meg of ram, and the system performance and the resource meter say that I have about 90% memory available? what is happening? is it running into the old 640k block? is there any way to fix this? or am I limited in the number of controls I can add to a form? if I can't fix the problem, is there a way I can determine how much memory is available through VB, so that I know when I have to quit adding controls?
0
Comment
Question by:chaos@tlc
[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
  • 3
  • 2
6 Comments
 

Expert Comment

by:Lucas041697
ID: 1427477
You reduce the resolution of the picture.
0
 

Author Comment

by:chaos@tlc
ID: 1427478
you can't reduce the resolution of an image control, and you can't change the resolution of the original image through VB. And I don't want to change the original image in any way.
0
 
LVL 2

Expert Comment

by:ChrisK
ID: 1427479
If you are attempting to load high res 24-bit images that will eat up memory in a hurry.  You can't have that many images open at the same time in your app.  The controls themselves shouldn't be to heavy on vb's memory.  So if you activate one or two images to start with, and then just load your new pictures as they are needed over the old ones,it will work, and you won't have to change your res or image color depth.
0
Technology Partners: 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!

 

Author Comment

by:chaos@tlc
ID: 1427480
ok, so why does everything else say I am only using 90% of memory? And is there any way I can tell how much memory I am using, so I can program in some limitations?
0
 
LVL 2

Accepted Solution

by:
ChrisK earned 300 total points
ID: 1427481
To my knowledge the Windows 95 mem free display isn't updated at a fast rate.  So if you alt+tab to it when you get a memory problem, chances are it hasn't updated and when a system error like out of memory accures, it can't update until the OK button is pushed, in which case the memory is then free'd up again.  There are several ocx's on the net which can tell you everything you need to know from free system memory to how much processor power your app is taking.  Visit http://pi1438.kub.nl:2080\/VisualBasicSource/scindex.htm and you will find the programs and info you seek.  Hope this answers all your questions...
0
 

Author Comment

by:chaos@tlc
ID: 1427482
Ok, so why does my system say I have only used 90% of the available memory? and if I am using up the memory, and the system simply isn't reflecting it, how can I check, using VB5, how much memory I have available?
0

Featured Post

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!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 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