On Mon, 13 Jan 2014, Fred van Stappen wrote:
> Date: Mon, 13 Jan 2014 12:32:53 +0100
> From: [email protected]
> To: [email protected]
> Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
>
>
>
> On Mon, 13 Jan 2014, Fred van Stappen wrote:
>
> >
> > >>> 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'));
>
> Remove the typecast PansiChar()
>
> Michael.
> >> Hello Michael and thanks for answer.
> But if i remove PansiChar(), i still get :
> An unhandled exception occurred at $0000000000000000:
> EAccessViolation: Access violation
> $0000000000000000
What is the value of Pointer(soundtouch_createInstance) after the above
statement ? Is it nil ?
Michael.
Thanks for answer Michael.
Hum, how can i get the value of pointer if the application crash when i do :
>> FHandle := soundtouch_createInstance();
Maybe, i dont understood your question...
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal