VB6 ErrorMessage : out of memory !

Posted on 2005-04-07
Last Modified: 2013-11-13
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.
Question by:b_rabet
    LVL 1

    Accepted Solution

    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.
    LVL 2

    Assisted Solution

    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).
    LVL 4

    Expert Comment

    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
    LVL 1

    Expert Comment

    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...
    LVL 4

    Expert Comment

    Ahah, yes i overlooked that (dumb me ).

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    dividesSelf challange 15 60
    Exe program is not a valid Win 32 application 15 76
    countAbc challenge 9 35
    firstChar challenge 13 57
    INTRODUCTION We all know how to code. But at times you simply want to insert a common code block into your existing code and amend it as per your requirements. This tool not only saves you time but also saves you the pain of typing it all out aga…
    A short article about problems I had with the new location API and permissions in Marshmallow
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    754 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

    16 Experts available now in Live!

    Get 1:1 Help Now