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

Daniel Franzini daniel.franzini at gmail.com
Thu Jan 11 17:58:52 CET 2007


this happens because windows API code usually have two versions: an Ascii
version where chars are 8-bit ASCII (with the suffix A, and used mainly in
9x code) and other where the chars are 2-byte unicode chars with the W
suffix, used mainly in 2000/XP stuff (guess W means wide in the sense of
widestring)

On 11/14/06, Gabor Boros <gaborboros at yahoo.com> wrote:
>
> Many thanks Felipe, the problem is the exported name(s).
> The exported names is SCAN_AllocateBuffer_A and SCAN_AllocateBuffer_W.
>
> Thanks again!
>
> Gabor
>
> Felipe Monteiro de Carvalho írta:
> > 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
> >
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



-- 
Daniel

"Let us change our traditional attitude to the construction of programs.
Instead of imagining that our main task is to instruct a computer what to
do, let us concentrate rather on explaining to human beings what we want a
computer to do." (Donald Knuth)

"Yes, technogeeks can be funny, even if only to each other." (
http://www.boogieonline.com/revolution/science/humor/)"

"Man is driven to create; I know I really love to create things. And while
I'm not good at painting, drawing, or music, I can write software."
(Yukihiro Matsumoto, a.k.a. ``Matz'')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070111/7efc2819/attachment.html>


More information about the fpc-pascal mailing list