[INCLUDE]
ctPackage

[CODE]
Public Function ctPackage_GetFileCount(ByVal ctPackagePointer As Long) As Long
  Dim xChar1 As String
  Dim ctPIType As ctPackage_InfoType
  
  If ctPackage_GetInfoEx(ctPackagePointer, ctPIType) Then
    xChar1 = String(4&, vbNullChar)
    'Get ctPIType.FileHandle, ctPIType.fileheader + ctPackageConst_HeaderPosFileCount, xChar1
    If Not SetFilePointer(ctPIType.FileHandle, ctPIType.FileHeader + ctPackageConst_HeaderPosFileCount, 0&, 0&) = -1& Then
      If Not ReadFile(ctPIType.FileHandle, ByVal xChar1, 4&, 0&, ByVal 0&) = 0& Then
        ctPackage_GetFileCount = ctPackage_LenCharToLong(xChar1)
        End If
      End If
    End If
  End Function
