Hola buenos días, ya se que este tema esta muy trillado, pero me ha saltado ahora y estoy algo desesperado.
Resulta que el envío de facturas me funcionaba a las mil maravillas, enviaba mas de 13 o 14 con mi librería capicom.dll.
El día de ayer me llama un cliente que tiene un s.o. de 64 bits y empieza a petar el envío con mas de 14 facturas.
Con las mismas me puse a buscar en este maravilloso foro y vi varias posibilidades de las cuales no me ha funcionado ninguna.
1ª.- Descargue la instalación de capicom a 64 bits y la registre. --> Error no envía mas de 14.
2ª.- Supuse que tendría que compilar mi app para Windows 64 bits, por lo que lo incluí windows 64 bit en Target Plattaforms
Código Delphi
[-]procedure TData.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp;
Data: Pointer);
var
Store : IStore;
Certs : ICertificates;
Cert : ICertificate2;
CertContext : ICertContext;
PCertContext : PCCERT_CONTEXT;
V : OleVariant;
const
INTERNET_OPTION_CLIENT_CERT_CONTEXT = 84;
begin
V:= trim(main.lista_certificados.Items.Text);
Store := CoStore.Create;
Store.Open(CAPICOM_CURRENT_USER_STORE, 'MY',CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED );
Certs:=Store.Certificates.Find(CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME,V,False );
if Certs.Count > 0 then
begin
Cert:=IInterface(Certs.Item[1]) as ICertificate2;
CertContext:=Cert as ICertContext;
CertContext.Get_CertContext(integer(PCertContext));
if InternetSetOption(Data,INTERNET_OPTION_CLIENT_CERT_CONTEXT,PCertContext,Sizeof(CERT_CONTEXT)) = False then
begin
ShowMessage( 'Internet SSL certificate. Something went wrong' );
end;
end;
end;
Código Delphi
[-][dcc64 Error] Datos.pas(188): E2197 Constant object cannot be passed as var parameter
Este error es por que PCertContext se debería declarar como constante, pero exactamente no se que valor se le debería dar.
Y ahí me he quedado.
Me podría alguien echar un cable, o darme unas nociones por si a lidiado con este Montoro ... digo Toro.
Gracias.