Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 19th, 2007, 04:28 AM
Authorized User
Join Date: May 2007
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jazzydonald
Default How can handle OutOfMemory Exception

Hi vb gurus
Am developing a program that loads members information from the sql db and then loads an image of application form of that member basing on the member's check no.

The image is being loaded from another software (document management software) using the API's of that software whereby the path of the image is returned by one the method and then the image is displayed on the picture box.

 Loading of data from sql DB works fine but loading of the image does not work fine, a message 'OutOfMemoryException Exception was unhandle' appears when executing the object that is supposed to hold the image and the path of the image.

Some troubleshooting tips i get is to see if have enogh memory for internal purposes and to check if am creating an array of the correct size but i dont have one.

My machine has a memory of 1 gb of RAM and has enough free space left. How do i handle this out of memory exception. Below is the sample of the code that produces an error.

Private Sub LoadImage()
        'Declare objects
        Dim myKoVIS, myTemplate, myDocs
        Dim myFile, myFiles
        Dim myDoc
        Dim ImagePath As String

        myKoVIS = CreateObject("Kofile.KoVIS.KoVIS")
        myKoVIS.Login("sysadmin", "sysadmin")

        myTemplate = myKoVIS.RetrievalTemplates("NHIF Membership Info_RD")

        myTemplate.Fields("CheckNo").Value1 = Trim(txtCheckNo.Text)
        myTemplate.Maxhits = 1
        myDocs = myTemplate.PerformRetrieval

        If myDocs.count <> 0 Then 'OutOfMemory Exception appears
                                  'here on the myDocs object
            myDoc = myDocs(1)
            myFiles = myDoc.Files
            myFile = myFiles(1)
            ImagePath = myFile.name

            PictureBox1.ImageLocation = ImagePath

        End If

    End Sub

Please help!

Old September 21st, 2007, 11:52 AM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

You probably will have to get support from the manufacturer of "Kofile.KoVIS.KoVIS"
Old October 5th, 2007, 07:10 AM
Authorized User
Join Date: May 2007
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jazzydonald

its now working fine but i dont remember what i did though i remember i had to reinstall the software(document management software) again. No 'out of memory ....' messages

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to handle OutOfMemory Exception FileFound Visual Studio 2005 4 July 3rd, 2007 07:23 AM
How to handle the JSP Exception in Java sheetm JSP Basics 0 December 5th, 2006 03:14 AM
How to handle error or exception if it occurs popoxinhxan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 August 27th, 2006 06:44 PM
How to handle...? chawnu Pro PHP 1 December 8th, 2005 05:14 AM
System.OutOfMemory Exception Ron Howerton ASP.NET 1.0 and 1.1 Professional 7 November 30th, 2005 10:08 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.