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

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


> On 01/17/2014 03:55 PM, Fred van Stappen wrote:
> > 
> >> > I run nm and find the name of the procedures ( PS : without
> > nm-Ewald's tip, you must be a high soothsayer to find it)
> >> > For example, a C called procedure : soundtouch_getVersionString()
> > becomes : _ZN10soundtouch10SoundTouch16getVersionStringEv() !!!
> >> >
> >>
> >> The _ZN10soundtouch10SoundTouch16getVersionStringEv name mangling
> >> suggests that this is a C++ lib, not a C lib. Generally speaking, you
> >> can't call C++ libs from fpc.
> >>
> >> Ludo
> > 
> > Yep, Ludo, many thanks to take care but...
> > 
> > I have a test program who use some procedures to test , for example :
> > 
> >  FVersionID := soundtouch_getVersionId();
> >  FVersionString := StrPas(soundtouch_getVersionString());  
> >  
> >   writeln(FVersionID);
> >   writeln(FVersionString);
> > 
> >>>> Result :
> > 
> >> 10800
> >> 1.8.0
> > 
> > So, it seems to work...
> > 
> > Those procedures are declared as this :
> > 
> > Pointer(soundtouch_getVersionId)    := GetProcAddress(LibHandle,
> > Pchar('_ZN10soundtouch10SoundTouch12getVersionIdEv')); 
> >  
> > Pointer(soundtouch_getVersionString):=
> > GetProcAddress(LibHandle,Pchar('_ZN10soundtouch10SoundTouch16getVersionStringEv')); 
> > 
> > 
> That are functions without any parameters that seemingly don't do a lot.
> Do you have any function working that takes a handle as a parameter?
> What is the value of the handle that was returned?

Yep Ludo, thanks to answer and...

Indeed, all the functions without any parameters are working.

And all the other must be initialized with  Soundtouch_setSampleRate(FHandle, samrate);

And, because it does not work, i cannot try the other procedures...

PS : FHandle := soundtouch_createInstance();
Seems to work (i do not get error message)

and this one works too : 
soundtouch_setChannels(FHandle, 2);

but this no :
soundtouch_setSampleRate(FHandle, 44100);

And without to set sample-rate, all other procedures are not working...

Many thanks


  
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140117/8f32d47d/attachment.html>


More information about the fpc-pascal mailing list