Lire le Username d'un fichier ID

Lire le Username d'un fichier ID

Messagepar Michael DELIQUE » 05 Nov 2007 à 16:55

Code : Tout sélectionner
Public Function ReadIDFile_API(wPathFile As String) As String
   
   'lit le username contenue dans le fichier ID
   
%REM
'variableAPI pour la fonction ReadIDFile_API
Declare Function REGGetIDInfo Lib "nnotes.dll" (Byval sIDFile As String, Byval lngInfoType As Long, Byval sResult As String, Byval lngBufferLength As Long, Byval lngBufferActual As Long) As Long
%END REM
   
   'Déclaration Variables
   Const REGIDGetName = 7
   Dim Buffer As String * 560
   Dim nbResult As Long
   Dim nbActual As Long
   
   On Error Goto ErreurHandle
   
   If Trim(wPathFile) = "" Then
      ReadIDFile_API = ""
      Exit Function
   End If
   
   ReadIDFile_API = ""
   Call REGGetIDInfo(wPathFile,REGIDGetName,Buffer,Len(Buffer),nbActual)
   If Trim(buffer) <> "" Then
      ReadIDFile_API = Left$(buffer,Instr(1,buffer,Chr$(0))-1)
   End If
   
   buffer = ""
   
   Exit Function
ErreurHandle:
   Msgbox "("+Structure_Log+" : "+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"   ReadIDFile_API = ""
   Exit Function
End Function
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers API