Solved

loadpicture() function fails, out of memory.

Posted on 1997-06-20
6
288 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 47
How to hault or freeze parent form when a 2d form is open in vb6 3 36
Macro Excel - Multiple If conditions 2 65
VB 6 error 5 in windows 10 but not in XP 7 46
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now