Val 0&amp;)
      ReadFile hFile, tID, Len(tID), dwBytesRead, ByVal 0&amp;
      If dwBytesRead = Len(tID) Then
         If (tID.idReserved = 0) Then ' No data in idReserved flag
            If (tID.idType = IMAGE_ICON) Then ' Is icon
               If tID.idCount &gt; 0 And tID.idCount &lt;= 256 Then ' sensible number
                of images?
                  ReDim tIDE(0 To tID.idCount - 1) As ICONDIRENTRY
                  For iEntry = 1 To tID.idCount
                     ReadFile hFile, tIDE(iEntry 