I'm trying to get my ListView to display thumbnails, but have hit a roadblock. I know not too many people at this level are still around... but maybe someone has some insight. Here's the most relevant section of code:
The main problem I'm having, in some folders it works ok. But other times, I keep getting "Automation errors" right before a crash. I can't even examine things more closely because VB completely locks up and I have to ctrl+alt+del it.
Anyone know anything about this?
VB Code:
Call isfParent.GetUIObjectOf(0&, 1&, pidlRelChild, IID_IExtractImage, 0&, iei) Debug.Print "2" If (iei Is Nothing) = False Then uThumbSize.cx = cxThumb uThumbSize.cy = cyThumb uThumbFlags = IEIFLAG_ASPECT Or IEIFLAG_SCREEN sRet = String$(MAX_PATH, 0) iei.GetLocation sRet, MAX_PATH, 0&, uThumbSize, 32, uThumbFlags sRet = GetStrFromBufferA(sRet) Debug.Print "InsertListItemEx::sRet=" Dim hThumb As Long, lRtn As Long iei.Extract hThumb Debug.Print "3" If hThumb Then lRtn = ImageList_Add(hIML_Thumb, hThumb, 0) If lRtn > -1 Then Debug.Print "4, lrtn=" & lRtn lvi.iImage = lRtn Debug.Print "5" Else DebugAppend "InsertListItemEx::Failed to add hThumb to hIML_Thumb" End If Else DebugAppend "InsertListItemEx::Failed to get hThumb" End If End If
The main problem I'm having, in some folders it works ok. But other times, I keep getting "Automation errors" right before a crash. I can't even examine things more closely because VB completely locks up and I have to ctrl+alt+del it.
Anyone know anything about this?