Attribute VB_Name = "API_FindFirstNextClose"
Option Explicit

Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long
Public Function msiFileExist(ByVal sPath As String, Optional ByVal sFileName As String) As Boolean
  
  Dim hFile As Long
  Dim WFD As WIN32_FIND_DATA
  Dim WholeFileName As String
  
  If sFileName = "" Then
    
    WholeFileName = sPath
    
  Else
    
    WholeFileName = AddLastBackSlashFunc(sPath) & sFileName
    
  End If
  
  hFile = FindFirstFile(WholeFileName, WFD)
  
  If hFile <> INVALID_HANDLE_VALUE Then
    
    msiFileExist = True
  
  Else
    
    msiFileExist = False
    
  End If
  
  Call FindClose(hFile)
  
End Function
Public Function TrimNull(startstr As String) As String

  TrimNull = Left$(startstr, lstrlen(StrPtr(startstr)))
   
End Function
