Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. An unhandled win32 exception occured in VB6.EX

An unhandled win32 exception occured in VB6.EX

Scheduled Pinned Locked Moved Visual Basic
databasehelpcsharpvisual-studio
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dileep_Vickey
    wrote on last edited by
    #1

    Hi all, I am trying to code for storing images into database as bytes and for its retrieval. It worked well. But if we try to load more than two pictures one by one then it shows an error as follows. --------------------------- Visual Studio Just-In-Time Debugger --------------------------- An unhandled win32 exception occurred in VB6.EXE [1160]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time. Check the documentation index for 'Just-in-time debugging, errors' for more information. --------------------------- OK --------------------------- I used GlobalAlloc function to allocate bytes of memory in my heap. I allocates almost 26347868 bytes in memory. I tried to free memory by using GlobalFree. But the result is same. I will be thankful to you for your help. Dileep trying to work as a freelancer.

    D D 2 Replies Last reply
    0
    • D Dileep_Vickey

      Hi all, I am trying to code for storing images into database as bytes and for its retrieval. It worked well. But if we try to load more than two pictures one by one then it shows an error as follows. --------------------------- Visual Studio Just-In-Time Debugger --------------------------- An unhandled win32 exception occurred in VB6.EXE [1160]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time. Check the documentation index for 'Just-in-time debugging, errors' for more information. --------------------------- OK --------------------------- I used GlobalAlloc function to allocate bytes of memory in my heap. I allocates almost 26347868 bytes in memory. I tried to free memory by using GlobalFree. But the result is same. I will be thankful to you for your help. Dileep trying to work as a freelancer.

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      Post your declaration of GlobalAlloc and GlobalFree - it looks like you may be passing the wrong parameter type...?

      '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

      1 Reply Last reply
      0
      • D Dileep_Vickey

        Hi all, I am trying to code for storing images into database as bytes and for its retrieval. It worked well. But if we try to load more than two pictures one by one then it shows an error as follows. --------------------------- Visual Studio Just-In-Time Debugger --------------------------- An unhandled win32 exception occurred in VB6.EXE [1160]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time. Check the documentation index for 'Just-in-time debugging, errors' for more information. --------------------------- OK --------------------------- I used GlobalAlloc function to allocate bytes of memory in my heap. I allocates almost 26347868 bytes in memory. I tried to free memory by using GlobalFree. But the result is same. I will be thankful to you for your help. Dileep trying to work as a freelancer.

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Dileep_Vickey wrote:

        But if we try to load more than two pictures one by one

        So what does this mean? Let's see the code that is storing and retrieving the images. How big are these images, in bytes?

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        D 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Dileep_Vickey wrote:

          But if we try to load more than two pictures one by one

          So what does this mean? Let's see the code that is storing and retrieving the images. How big are these images, in bytes?

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          D Offline
          D Offline
          Dileep_Vickey
          wrote on last edited by
          #4

          Hi all, Sorry to be late.

          Dave Kreskowiak wrote:

          So what does this mean?

          I meant, I can open any picture i stored in sql database in a picturebox. I stored picture as bytes. Opening of first and second picture (randomly from database) work smoothly. But when i try to open third image then it will show that error. I used following function to retrieve image from collection of bytes. Public Function PictureFromBits(abPic() As Byte) As IPicture ' abPic() as a byte array Dim nLow As Long Dim cbMem As Long Dim hMem As Long Dim lpMem As Long Dim IID_IPicture As GUID Dim istm As stdole.IUnknown Dim ipic As IPicture On Error GoTo Out GlobalFree (hMem) nLow = LBound(abPic) On Error GoTo 0 cbMem = (UBound(abPic) - nLow) + 1 hMem = GlobalAlloc(GMEM_MOVEABLE, cbMem) If hMem Then lpMem = GlobalLock(hMem) If lpMem Then MoveMemory ByVal lpMem, abPic(nLow), cbMem Call GlobalUnlock(hMem) If (CreateStreamOnHGlobal(hMem, CTrue, istm) = S_OK) Then If (CLSIDFromString(StrPtr(sIID_IPicture), IID_IPicture) = S_OK) Then Call OleLoadPicture(ByVal ObjPtr(istm), cbMem, CFalse, IID_IPicture, PictureFromBits) End If End If End If End If GlobalFree (hMem) Exit Function Out: MsgBox "Out" End Function I think this is a problem regarding memory. Please help.

          Dave Kreskowiak wrote:

          How big are these images, in bytes?

          I opened images with almost all sizes. eg: 57060 Bytes. Thanking for your interest.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups