tengo un error al tratar de generar el Codigo de Barras Bidimensional (CBB), para incluirlo en la factura impresa del CFDI, pero al tratar de cargar la libreria me marca el siguiente error
System Error. Code 126
The specified module could not be found
al principio crei que no estaba bien ubicada la dll , o que estaba dandole mal el nombre en el codigo, y no era asi
este es el codigo donde intento cargar la DLL
Código: Seleccionar todo
function Genera_CBB(Texto, FName : String) : Integer;
var
HLib : Cardinal;
GenCBB : procedure(Cadena : String; FileName : String); stdcall;
begin
HLib := LoadLibrary('QRCodeLib.dll');
if hlIB = 0 then
RaiseLastOSError();
if HLib <= 32 then
begin
MessageBox(0, 'Error : No Se Pudo Cargar Libreria QRCodeLib.dll', 'Oops', MB_OK);
Result := -1;
exit;
end
else
begin
GenCBB := GetprocAddress(HLib, 'FastQRCode');
if not Assigned(GEnCBB) then
begin
MessageBox(0, 'Error : No se Encontro la Funcion FastQRCode en la Libreria QRCodeLib.dll', 'Oops', MB_OK);
Result := -1;
exit;
end;
end;
GenCBB(Texto, FName);
FreeLibrary(HLib);
end;
Código: Seleccionar todo
if hlIB = 0 then
RaiseLastOSError();
y esto es lo que me encontre acerca de este error en StackOverFlow
GetLastError reports 126, i.e. ERROR_MOD_NOT_FOUND. Clearly a module cannot be found.
There are two obvious causes for this:
1.- The module you are trying to load cannot be found.
2.- The module you are trying to load can be found, but one of the modules that it depends on cannot be found.
I would recommend debugging this with Dependency Walker in profile mode. This will monitor your app at runtime and tell you precisely which module cannot be found.
Finally, in this day and age, you really should be opting for LoadLibraryW
Segui las instrucciones del punto 2. y me encontre las siguientes dependencias que tienen error o que estan ausentes
GPSVC.DLL
IESHIMS.DLL
baje el IESHIMS.DLL Y lo instale en la carpeta donde se encuentra la aplicacion, tambien lo intente con la GPSVC.DLL, pero al hacerlo me manda mas errores de dependencias
Tambien intente con LoadLibraryW y tampoco funciono
no sera la version de delphi o windows con la que esta compilada la libreria QRCodeLib.dll?, o tengo que hacer alguna otra cosa?
Gracias por tu ayuda
PD. Estoy usando Delphi XE