An unhandled win32 exception occured in VB6.EX
-
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.
-
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.
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
-
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.
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 -
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, 2007Hi 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.