> Date: Mon, 13 Jan 2014 11:58:21 +0100 > From: mich...@freepascal.org > To: fpc-pascal@lists.freepascal.org > Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress() > > > > On Mon, 13 Jan 2014, Fred van Stappen wrote: > > > Hello. > > > > I have a external dll. In Windows i can access perfectly the procedures with > > GetProcAddress() if i use Windows unit. > > > > If i use DynLibs unit, prog crash when i try to load the procedure. > > I prefer to use DynLibs unit because i want to use the dll for Linux too > > (of course with library.so). > > > > I have try, in linux to access the procedure with DynLibs too but same > > crash than for Windows. > > What must i do to access procedure with DynLibs ? > > Can you be more specific ? What error do you get ? Can show some code ? > > Michael.
Hello and many thanks for answer. The library is SoundTouch.dll and libSoundTouch.so from : >> http://www.surina.net/soundtouch/ >>>Here part of working code (if i call soundtouch_createInstance, it works) ... uses Windows ; ... var soundtouch_createInstance : function() : THandle; stdcall; ... procedure InitLib(LibFile : PAnsiChar); begin LibHandle := LoadLibrary(LibFile); if LibHandle <> 0 then Pointer(soundtouch_createInstance) := GetProcAddress(LibHandle, PAnsiChar('soundtouch_createInstance')); ///////////////////// >>> Here part of NOT working code (if i call soundtouch_createInstance, it >>> crash) ... uses dynlibs ; ... var soundtouch_createInstance : function() : THandle; stdcall; ... procedure InitLib(LibFile : PAnsiChar); begin LibHandle:=DynLibs.LoadLibrary(libfilename); if LibHandle <> DynLibs.NilHandle then Pointer(soundtouch_createInstance) := DynLibs.GetProcedureAddress(LibHandle, PAnsiChar('soundtouch_createInstance')); ///////////////////// Many thanks.
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal