On 13/01/14 13:36, Fred van Stappen wrote:
[...] 
> Hello Lucaz
> 
> /// why not just :
>>
>> @soundtouch_createInstance := DynLibs.GetProcedureAddress(LibHandle, 
>> PAnsiChar('soundtouch_createInstance'));
>>
> 
> Get that error :
> 
>>> libSoundTouch.pas(56,5) Error: Can't assign values to an address
> 

This (@syntax) is in (OBJ)FPC mode, your example is Delphi mode.



http://wiki.freepascal.org/Lazarus/FPC_Libraries#Loadlibrary_-_dynamically_loading_a_dynamic_library

http://forum.lazarus.freepascal.org/index.php?topic=1148.0

OK I stand corrected, re. the pointer() cast... 

but then why not declare in a public header for this wrapper:
type
  TSoundtouchCreateInstanceProc = procedure;

then
soundtouch_createinstance := 
TSoundtouchCreateInstanceProc(DynLibs.GetProcedureAddress(...));

(nb. delphi mode)

?

-L.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to