[fpc-pascal] Get value of PPChar ?
Christo Crause
christo.crause at gmail.com
Sun Apr 16 17:23:30 CEST 2017
I suppose you have to allocate memory and create a pointer to a pointer to
this memory which you pass to the function.
On 16 Apr 2017 4:58 PM, "fredvs" <fiens at hotmail.com> wrote:
> Hello.
>
> A C method is defined like this:
>
> MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);
>
> and translated in Pascal with this:
>
> function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PPChar): integer;
> cdecl;
>
> OK, the function seems to work because the result = 0 (no error).
>
> But how to retrieve the data icy_meta (PPChar) ?
>
> var
> theicytag : PPChar;
> resu : integer;
> ...
>
> resu := mpg123_icy(ahandle, theicytag);
> if resu = 0 then writeln(theicytag^); --> raise exception + crash
>
> resu := mpg123_icy(ahandle, theicytag);
> if resu = 0 then writeln(theicytag^^); --> also raise exception + crash
>
> Fre;D
>
>
>
>
>
> -----
> Many thanks ;-)
> --
> View this message in context: http://free-pascal-general.
> 1045716.n5.nabble.com/Get-value-of-PPChar-tp5728277.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170416/5802681c/attachment.html>
More information about the fpc-pascal
mailing list