[fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

Fred van Stappen fiens at hotmail.com
Fri Jan 17 16:06:14 CET 2014


> Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
> 
> In our previous episode, Fred van Stappen said:
> > I have only a problem with one procedure:
> > 
> > This c procedure is declared as this :
> > SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, unsigned int srate);
> > 
> > And i translate it like that :
> > 
> > soundtouch_setSampleRate : procedure(h : THandle; srate :  cardinal); cdecl;
> > and for dynamic-loading :
> > Pointer(soundtouch_setSampleRate):= GetProcAddress(LibHandle, Pchar('_ZN10soundtouch10SoundTouch13setSampleRateEj'));
> > 
> > Sadly i get that message when i try to load that procedure :  
> 
> Handle is not defined on Linux. Many libraries emulate some handle type, but
> it depends on the vendor if they make handle 32-bit or 64-bit.
> 
> Make sure that sizeof(HANDLE) in C++  matches sizeof(THandle) in FPC. Adjust
> the type you use at the FPC side if necessary.


Yep, Marco, many thanks...

Hum, :
> Make sure that sizeof(HANDLE) in C++  matches sizeof(THandle) in FPC. 
>Adjust  the type you use at the FPC side if necessary.  

How to do that ? (sorry, i do not understand)
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140117/3b6d2940/attachment.html>


More information about the fpc-pascal mailing list