Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mDNSResponder DLL.NET doesn't marshal strings correctly



Pavel,

I think I'm not understanding what you need from a .NET implementation. But I'm curious:

Which version of the mDNSResponder source are you using? CVS branch? I'm looking at 58.8 .

On Jul 19, 2004, at 12:39 PM, Pavel Repin wrote:

CharSet property of DllImport attribute does not support UTF8 marshalling.
CharSet.Unicode marshalling is used to call DLL functions that expect
LPCWSTR or LPWSTR.
dns_sd functions expect 0-terminated sequences of bytes, not wchar_t's.

Would redefining wchar_t be an alternative? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ vccore/html/vclrfZcwchar_t.asp


wchar_t could be redefined as a type that P/Invoke and .NET can marshal without custom code.



When I toyed with writing a dnssd.dll wrapper in C#, I had to write a custom
marshaller to successfully pass strings from C# code to dns_sd and back.
See MarshalAs attribute documentation.

IMHO this shouldn't need custom marshalling.

Rob
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.


References: 
 >RE: mDNSResponder DLL.NET doesn't marshal strings correctly (From: Pavel Repin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.