lucas99
Membros-
Total de ítens
2 -
Registro em
-
Última visita
lucas99's Achievements
-
The requested operation has been cancelled by the user
lucas99 replied to lucas99's tópico in Object Pascal - Delphi & Lazarus
Eu quero que selecione o certificado e me passa o numero serial, ate ai ok. mas quando cancelo a operação aparece esta mensagem: Como faço para não aparece essa mensagem? apenas sair da tela do Windows Store Certificate -
The requested operation has been cancelled by the user
um tópico no fórum postou lucas99 Object Pascal - Delphi & Lazarus
Boa tarde Pessoal, sou novo em Delphi, uso mais para estudos estou com o Seguinte erro, quando aperto para cancelar a operação, estou utilizando o CAPICOM_TLB, segue minha linha de codigo: unit teste; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ACBrBase, ACBrDFe, Vcl.StdCtrls, CAPICOM_TLB; type TForm1 = class(TForm) Edit1: TEdit; Button1: TButton; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); Var i : integer; Store : IStore3; Cert : ICertificate2; Certs : ICertificates2; begin Store := CoStore.Create; Store.Open(CAPICOM_CURRENT_USER_STORE, 'MY', CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED); Certs := Store.Certificates as ICertificates2; Certs.Select ('Selecione um Certificado','Selecione o Certificado que deseja utilizar:', false); Cert := IInterface(Certs.Item[1]) as ICertificate2; try Edit1.Text := Cert.SerialNumber; Except on E: Exception do if E.Message = 'The requested operation has been cancelled by the user' then exit; // If Not (Certs.Count = 0) then Begin // Cert := IInterface(Certs.Item[1]) as ICertificate2; // Edit1.Text := Cert.SerialNumber; // End; end; end; end.