Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3920
  • Last Modified:

VB6 ErrorMessage : out of memory !

Hi every body :

I wrote a graphic program in vb6 (in a MDI window) which is most likely to microsoft paint but when run the exe file in different computers I got different responses in some cases it works properly but in other I saw  "out of memory !" error message .I'm sure it is not because of System Memory (RAM) .in some cases in one pc but in win98 I got that error and in winXP it works  !!

I would appreciate if any body suggest me a way to solve this problem .

thanks in advance.
0
b_rabet
Asked:
b_rabet
  • 2
  • 2
2 Solutions
 
rcruxCommented:
You need to do a little debugging to figure out where does this happens on the code.
Remember that Win 9x/ME do not manage system resources (in your case GUI resourses) the same way that NT based systems do (WinXP, 2000, etc..).

If you can trace the code instruction where the crash occurs, post it here and I might help you.
0
 
-dev-Commented:
The 'out of memory' error can come from a number of things but the best way to determine it is to run the actual code on a machine that gives you the error. That would involve installing VB6 on that machine and copying your code to it. You will usually see this error during a loop in the code or when a file is missing (like a dll/ocx).
0
 
FalconHawkCommented:
Well, XP needs a minimum of 128 mb to run, and 98 needs... a fraction of that. So its most likely that the XP machine has a lot more memory. Have a loot at the configuration screens to see how much you have. Moreover, XP uses PAGING memory. Paging memory is using a part of the harddisk as if it was normal memory. This is a lot slower then regular RAM, but it might be enough to keep your app running
0
 
rcruxCommented:
I sorry to disagree. I had these sort of problems in my hands before.
It really donsen't matter how much memory you can put on a Win9x/ME system. System resources ane NOT hardware resources. The system it self (windows) has it's own limitations regarding proccess/application management. The NT systems are truely MultiThreading Systems. Windows 9X/ME are not.

On your code you should always apply this best practices:
when you create a Object you should always destroy it once you don't need it anymore
when using CreateObject API you must be very caerefull when you call (and you must call) DeleteObject. It's behaviour is different on different systems and for different king of objects..
and there's a lot more I don't remenber right now... but mainlly, using windows API calls must not be taken lightly.

once again, debug the app...
0
 
FalconHawkCommented:
Ahah, yes i overlooked that (dumb me ).
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!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now