          For iEntry = 0 To m_tID.idCount - 1
               WriteFile hFile, m_tBits(iEntry).bBits(0),
                m_tIDE(iEntry).dwBytesInRes, dwBytesWritten, ByVal 0&amp;
               If (m_tIDE(iEntry).dwBytesInRes &lt;&gt; dwBytesWritten) Then
                  bFail = True
                  Exit For
               End If
            Next iEntry
         End If
      Else
         bFail = True
      End If
      
      ' Close the file:
      CloseHandle hFile
      
      ' Did we succeed?
     