AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TSmartCard für Delphi 2010

Ein Thema von hoika · begonnen am 3. Mai 2011 · letzter Beitrag vom 17. Apr 2013
 
Benutzerbild von Deep-Sea
Deep-Sea

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

AW: TSmartCard für Delphi 2010

  Alt 9. Mai 2011, 13:34
Ja was hast du denn geändert?
Bei mir sieht SetActive so aus, wobei die Konstante DllFile vor meiner Änderung DllFile32 oder so ähnlich hieß:
Delphi-Quellcode:
procedure TSmartCard.SetActive(Value: Boolean);
var
  C,L,I: LongInt;
  S: AnsiString;
begin
  if Value = FActive then exit;
  try SetCursor (LoadCursor (0, IDC_WAIT));

  if Value then begin
    if FLibHandle > 0 then FreeLibrary(FLibHandle);
    FLibHandle:=2;
    FLibHandle:=LoadLibrary(DllFile);
    if FLibHandle < HINSTANCE_ERROR then
      Error('Invalid/missing SmartCard library '+ DllFile +
            ' (Error code '+IntToStr(FLibHandle)+')'+#13#10+
            'Pls. download latest version at: http://www.towitoko.de');
    {$IFDEF SCARDDIR}
    FSCardComand:=SCardComand;
    {$ELSE}
    @FSCardComand:=GetProcAddress(FLibHandle, 'SCardComand');
    {$ENDIF}
    if not Assigned(FSCardComand) then begin
      FreeLibrary(FLibHandle);
      FLibHandle:=0;
      Error('Invalid SmartCard library '+StrPas(PAnsiChar(@DllFile[1]))+
            ' (version mismatch)'+#13#10+
            'Pls. download latest version at: http://www.towitoko.de');
    end;
    FTDevHandle:=0;
    L:=-1; C:=0;
    S:=cmSystem+cmAddHWndMsg+
       IntToStr(FWindowHandle)+','+IntToStr(TDEVMSG)+#0;
    I:=FSCardComand(L,@S[1],C,nil,C,nil,C);
    if (I > 0) or (L <= 0) then begin
      FreeLibrary(FLibHandle);
      FLibHandle:=0;
      Error('Cannot access SmartCard Server: '+IntToHex(I,4));
    end;
    FTDevHandle:=L;
    FActive:=True;
    GetDeviceList;
    InsertMenuItems;
  end else begin
    try Comand(cmSystem+cmDelHWnd+IntToStr(FWindowHandle),nil,0,nil,0); except end;
    try Comand(cmSystem+cmDestroy,nil,0,nil,0); except end;
    FreeLibrary(FLibHandle);
    FLibHandle:=0;
    FActive:=False;
  end;
  finally Screen.Cursor:=crDefault; end;
end;
Chris
Die Erfahrung ist ein strenger Schulmeister: Sie prüft uns, bevor sie uns lehrt.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:16 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz