Hola, estoy luchando con una Dll de una impresora Epson Fiscal (TM900), la que viene en la definición
DLL_EXPORT_IMPORT int DLL_STD_CALL
ConsultarVersionDll( char *respuesta_descripcion, int respuesta_descripcion_largo_maximo, int *respuesta_mayor, int *respuesta_menor );
En un ejemplo que trae la misma librería esta definida :
Código Delphi
[-]type
TConsultarVersionDll = function ( descripcion : PChar; descripcion_largo_maximo: LongInt; var mayor : LongInt; var menor : LongInt) : LongInt; StdCall;
var
dll : THandle;
error : LongInt;
str : Array[0..100] of Char;
mayor : LongInt;
menor : LongInt;
ConsultarVersionDll: TConsultarVersionDll;
begin
dll := 0;
dll := LoadLibrary('EpsonFiscalInterface.dll');
if dll = 0 then
begin
ShowMessage('Error al instanciar DLL');
Exit;
end;
@ConsultarVersionDll := GetProcAddress(dll, 'ConsultarVersionDll');
if not Assigned(ConsultarVersionDll) then
begin
ShowMessage('Error al asignar funcion: ConsultarVersionDll');
Exit;
end;
mayor := 0;
menor := 0;
str := StringOfChar (' ', 100);
error := ConsultarVersionDll( str, 100, mayor, menor );
ShowMessage( str );
ShowMessage( IntToStr(mayor) );
ShowMessage( IntToStr(menor) );
ShowMessage( IntToStr(error) );
FreeLibrary(dll);
end;
Esto siempre da error y he probado cambiar los tipo de datos pero nada funciona