Stack Overflow Exception

Posted on 2005-05-04
Last Modified: 2010-04-23
I receive a stack overflow exception with the following code.  The file being openned is 120mb.

        Dim b() As Byte
        Dim bfile As Integer
        bfile = FreeFile()
        FileOpen(bfile, ZipFile, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)

        ReDim b(LOF(bfile) - 1)
        FileGet(bfile, b)
Question by:shawnlehner
    LVL 8

    Accepted Solution

    does the exception occur on the line where you open the file?
    FileOpen(bfile, ZipFile, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared) ' <--

    If so, try running task manager as you step through the code and see how much memory you have available on your machine.

    Is this the only thing that your app is doing at that moment? If not, try to isolate that code block and run it on its own in a separate app and see if the problem still occurs.

    Let me know if this helps or not,

    LVL 4

    Author Comment

    checked memory usage... i think its a variable problem
    LVL 8

    Expert Comment


    can I ask why you gave me a grade C?

    Please read the help section:

    subheading: "Grade quickly and fairly"

    If you found the answer to your question by yourself, then maybe you could have asked to delete the question, otherwise, if my comment help you in the right direction without giving you the full solution, you should probably have given a B.

    Best Regards,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now