Bonsoir tous le monde,
Je viens quérir votre aide afin de convertir ce bout de code de sorte qu'il fonctionne sous D10.2 sans me confronter au message d'erreur suivant:
StrPas est déprécié moved to the AnsiString unit.
le bout de code:
j'avoue avoir du mal avec les conversions style Char = AnsiChar , string = AnsiString, etc...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 function TPCSCRaw.SCErrToStr(ErrorCode: DWord): ansistring; var Flags: DWord; buff: array[0..255] of Ansichar; begin Flags:=FORMAT_MESSAGE_FROM_HMODULE or FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_IGNORE_INSERTS; {Len:=}FormatMessage(Flags,Pointer(fhWinSCard), ErrorCode, 0, @buff[0], 250, nil); result:=StrPas(buff); if (Result='') then begin (* this should not happen, but we've seen it.... *) Result:=IntToHex(GetLastError(), 8); Exit; end; if Copy(Result,Length(Result)-1,2)=#13#10 then SetLength(Result, Length(Result)-2); end;
et l'aide fournie sur le wiki embarcadero ne m'aide pas à mieux comprendre http://docwiki.embarcadero.com/Libra...ysUtils.StrPas
Vous remerçiant pour toutes explications / solutions éventuelles pouvant m'être fournie (niveau débutant).
Bien à vous
Partager