Einzelnen Beitrag anzeigen

Benutzerbild von Deep-Sea
Deep-Sea

Registriert seit: 17. Jan 2007
907 Beiträge
 
Delphi XE2 Professional
 
#2

AW: TSmartCard für Delphi 2010

  Alt 3. Mai 2011, 09:05
Und sonst funktioniert alles?!
Ich hab nämlich für D2009 u.a. noch folgende Funktionen angepasst:
Delphi-Quellcode:
function TSmartCard.ComandStr(const Cmd,DataIn: AnsiString): AnsiString;
begin
  if DataIn = 'then
  begin
    SetLength(Result, 255);
    SetLength(Result, Comand(Cmd,nil,0,@Result[1], Length(Result)));
  end else begin
    SetLength(Result, 255);
    SetLength(Result, Comand(Cmd,@DataIn[1],Length(DataIn),@Result[1], Length(Result)));
  end;
end;

function TSmartCard.Comand(const Cmd: AnsiString;
                            DataIn: Pointer; DataInLen: LongInt;
                            DataOut: Pointer; DataOutMax: LongInt
                            ): LongInt;
var R,L,M: LongInt; C: AnsiString;
begin
  try
    Result:=DataOutMax;
    if not FActive then Error('SmartCard component not activated');
    L:=Length(Cmd);
    if L = 0 then
      R:=FSCardComand(FTDevHandle,nil,L,
                      DataIn,DataInLen,DataOut,Result)
    else
      R:=FSCardComand(FTDevHandle,@Cmd[1],L,
                      DataIn,DataInLen,DataOut,Result);
    if R > 0 then begin
      Result:=0;
      C:=cmSystem+cmInfo+cmErrText;
      L:=Length(C);
      M:=0;
      SetLength(FError, 255);
      R:=Length(FError);
      FSCardComand(FTDevHandle,@C[1],L,nil,M,@FError[1],R);
      SetLength(FError, R);
      Error(FError);
    end;
  except
    Result:=0;
    if not (csDesigning in ComponentState) then raise;
  end;
end;
Vergleichs mal mit deinen Aber ob's daran liegt weiß ich natürlich nicht ...
Chris
Die Erfahrung ist ein strenger Schulmeister: Sie prüft uns, bevor sie uns lehrt.
  Mit Zitat antworten Zitat