Olá,
Estou com um problema relacionado com a dll capicom no delphi XE5 e XE8 para ambiente x64. Ao acionar o comando lStore := CoStore.Create, ocorre o erro "Classe não registrada". Isso porque o delphi está buscando a referência do c:\windows\system32 ao invés de buscar as dll do diretório c:\windows\SysWOW64. No ambiente x86 está funcionando corretamente.
function TForm1.GetCertificadosServer: TCertificadoItem; var lStore, lCertificadosLista, lCertDados: OleVariant; i: integer; begin Result := nil; CoInitialize(nil); try lStore := CoStore.Create; lStore.Open(CAPICOM_CURRENT_USER_STORE, 'My', CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED);
lCertificadosLista := IInterface(lStore.Certificates) as ICertificates2; if (lCertificadosLista.Count > 0) then Result := TCertificadoItem.Create;
for i := 1 to lCertificadosLista.Count do begin lCertDados := IInterface(lCertificadosLista.Item) as ICertificate2; with Result do begin Version := lCertDados.Version; SerialNumber := lCertDados.SerialNumber; SubjectName := lCertDados.SubjectName; IssuerName := lCertDados.IssuerName; ValidFromDate := lCertDados.ValidFromDate; ValidToDate := lCertDados.ValidToDate; Thumbprint := lCertDados.Thumbprint; end; end; lStore.Close; finally CoUninitialize; end; end;