[Mono-list] Managed equivalent of memset?
Frederik Carlier
frederik.carlier at ugent.be
Tue Feb 20 10:21:04 EST 2007
Mike,
Thanks! That fixed it and of course explains the Assertion I got. At the
end, it didn't have anything to do with memset - just me looking at the
wrong part of my code!
Frederik.
Mike Welham schreef:
> Hi Frederik
>
>> public struct TidyBuffer
>
> ...
>
>> [DllImport("libtidy")]
>> public static extern int tidySetErrorBuffer(IntPtr tdoc,
>> TidyBuffer errbuf);
>
> ...
>
>> int TIDY_CALL tidySetErrorBuffer(TidyDoc tdoc, TidyBuffer * errbuf)
>
> It seems to me you P/Invoke signature is wrong - the managed version
> is passing the struct by value, the native code expects a pointer.
>
> Perhaps changing the second parameter of the P/Invoke signature to
> "ref TidyBuffer errbuf" may fix it.
>
> Regards
>
> Mike
More information about the Mono-list
mailing list