Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

loadpicture() function fails, out of memory.

Posted on 1997-06-20
6
Medium Priority
?
318 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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

824 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