<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'>Date: Mon, 13 Jan 2014 12:32:53 +0100<br><div>From: michael@freepascal.org<br>To: fpc-pascal@lists.freepascal.org<br>Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()<br><br><pre> <br> <br>On Mon, 13 Jan 2014, Fred van Stappen wrote:<br> <br>> <br>> >>> Here part of NOT working code (if i call soundtouch_createInstance, it crash)<br>> ...<br>> uses <br>> dynlibs ;<br>> ...<br>> <br>> var<br>> soundtouch_createInstance : function() : THandle; stdcall; <br>> <br>> ...<br>> <br>> procedure InitLib(LibFile : PAnsiChar);<br>> begin<br>> LibHandle:=DynLibs.LoadLibrary(libfilename);<br>> if LibHandle <> DynLibs.NilHandle then<br>> <br>> Pointer(soundtouch_createInstance) := DynLibs.GetProcedureAddress(LibHandle, PAnsiChar('soundtouch_createInstance'));<br> <br>Remove the typecast PansiChar()<br> <br>Michael.<br><br>>> Hello Michael and thanks for answer.<br>But if i remove PansiChar(), i still get :<br><br>An unhandled exception occurred at $0000000000000000:<br>EAccessViolation: Access violation<br> $0000000000000000<br><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>