[Mono-list] DllImport ... help
Paolo Molaro
lupus@ximian.com
Mon, 17 Jun 2002 20:05:03 +0200
On 06/15/02 Jonathan Pryor wrote:
> For example, the following works with .NET
>
> // native.c
> // Native library
> #include <string.h>
>
> #ifdef _MSC_VER
> __declspec(dllexport)
> #endif
> int getname(char* s, unsigned int n)
> {
> const char m[] = "This is my message. Isn't it nice?";
> strncpy(s, m, n);
> return 0;
> }
[...]
> public class ghbn {
> [DllImport("native")]
> private static extern int getname(
> StringBuilder sb,
> uint len);
What happens if getname() takes a wchar_t? Do you have to specify
additional information in a MarshalAs attribute?
BTW, if anyone can find the documentation that the class docs calls
"Data Marshaling Specification" I'll be grateful.
lupus
--
-----------------------------------------------------------------
lupus@debian.org debian/rules
lupus@ximian.com Monkeys do it better