<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>On Mon, 13 Jan 2014, Fred van Stappen wrote:<br><div><pre> <br>> <br>> On Mon, 13 Jan 2014, Fred van Stappen wrote:<br>><br>> <br>> > > > begin<br>> > > > LibHandle:=DynLibs.LoadLibrary(libfilename);<br>> > > > if LibHandle <> DynLibs.NilHandle then<br>> > > > <br>> > > > Pointer(soundtouch_createInstance) := DynLibs.GetProcedureAddress(LibHandle, PAnsiChar('soundtouch_createInstan<br>> ce<br>> > '));<br>> > > <br>> > > Remove the typecast PansiChar()<br>> > > <br>> > > Michael.<br>> > > >> Hello Michael and thanks for answer.<br>> > > But if i remove PansiChar(), i still get :<br>> > > An unhandled exception occurred at $0000000000000000:<br>> > > EAccessViolation: Access violation<br>> > > $0000000000000000<br>> > <br>> > What is the value of Pointer(soundtouch_createInstance) after the above statement ? Is it nil ?<br>> > <br>> > Michael.<br>> > Thanks for answer Michael.<br>> > <br>> > Hum, how can i get the value of pointer if the application crash when i do :<br>> > <br>> > >> FHandle := soundtouch_createInstance(); <br>> <br>> Do a<br>> <br>> Writeln((@soundtouch_createInstance)=Nil);<br>> <br>> Michael.<br>> ___________<br>> Thanks Michael.<br>> Result in Linux for :<br>> if ST_Load('/home/fred/libSoundTouch/libSoundTouch.so')<br>> then writeln('ok') else writeln('no') ;<br>> >> ok<br>> Writeln((@soundtouch_createInstance)=Nil);<br>> >> FALSE<br>> I agree it is very strange, in windows, with unit Windows, it works perfectly..<br> <br>Wait.<br> <br>What happens if you use dynlibs on windows ?<br> <br>Because there can be 1000 other reasons why the load failed on linux, <br>not necessarily connected to dynlibs.<br> <br>Michael.<br>____________________________________________<br><br>Yep, Michael, many thanks for helping.<br><br>>> What happens if you use dynlibs on windows ?<br><br>Exactly the same as for Linux, it crash.<br><br>What i do not understand it is why, with Windows unit, it works perfectly and with Dynlibs unit, it crash. (with same code, of course).<br><br></pre><br>_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</div> </div></body>
</html>