Solved

loadpicture() function fails, out of memory.

Posted on 1997-06-20
6
286 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 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

23 Experts available now in Live!

Get 1:1 Help Now