[fpc-pascal] How can i detect what cause the problem

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Nov 14 13:44:39 CET 2006


Can you show us the c declaration of the function you are calling? It
should be on a .h file.

Also, you should put an way to verify if the calls are working, like:

    DLL_Handle:=LoadLibrary('SCNAPI32.DLL');

    if DLL_Handle = nil then raise EException.Create('Could not load library');

    Pointer(SCAN_AllocateBuffer):=GetProcedureAddress(DLL_Handle,
 'SCAN_AllocateBuffer');

    if Pointer(SCAN_AllocateBuffer) = nil then raise
EException.Create('Could not load procedure');

One possibility is that this C library uses name mangling, and the
function has a different name from the canonical one. You can check
all function names exported by the function using this software:

http://wiki.lazarus.freepascal.org/Libview

-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list