[Mono-list] Managed equivalent of memset?

Mike Welham mwelham at gmail.com
Tue Feb 20 09:41:04 EST 2007


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