Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21285

Help with Thumbnail View

$
0
0
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:

VB Code:
  1. Call isfParent.GetUIObjectOf(0&, 1&, pidlRelChild, IID_IExtractImage, 0&, iei)
  2.     Debug.Print "2"
  3.     If (iei Is Nothing) = False Then
  4.  
  5.         uThumbSize.cx = cxThumb
  6.         uThumbSize.cy = cyThumb
  7.         uThumbFlags = IEIFLAG_ASPECT Or IEIFLAG_SCREEN
  8.         sRet = String$(MAX_PATH, 0)
  9.         iei.GetLocation sRet, MAX_PATH, 0&, uThumbSize, 32, uThumbFlags
  10.         sRet = GetStrFromBufferA(sRet)
  11.         Debug.Print "InsertListItemEx::sRet="
  12.         Dim hThumb As Long, lRtn As Long
  13.         iei.Extract hThumb
  14.         Debug.Print "3"
  15.         If hThumb Then
  16.             lRtn = ImageList_Add(hIML_Thumb, hThumb, 0)
  17.             If lRtn > -1 Then
  18.                 Debug.Print "4, lrtn=" & lRtn
  19.                 lvi.iImage = lRtn
  20.                 Debug.Print "5"
  21.             Else
  22.                 DebugAppend "InsertListItemEx::Failed to add hThumb to hIML_Thumb"
  23.             End If
  24.         Else
  25.             DebugAppend "InsertListItemEx::Failed to get hThumb"
  26.         End If
  27.     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?

Viewing all articles
Browse latest Browse all 21285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>