I'm using the GetPrivateProfileString API and I just realised it was causing an error to mycode. I used the CIniFile class provided on vbworld.

Look carefully at the line in red, it fills the var all with 0. I need to remove them after, how do I achieve this ?



Code:
Public Function GetFile(strSection As String, _
  strKey As String) As String

  Dim strTmp As String
  Dim lngRet As String

  strTmp = String$(100, 0) 
  lngRet = GetPrivateProfileString(strSection, _
    strKey, "", strTmp, _
    Len(strTmp), strInI)
    
  GetFile = strTmp
 
End Function