I've written a custom marshaler for DateTime, but I can't seem to get it
to be used with a COM object.  Custom marshaling seems straightforward
with simple PInvokes; but it seems to be ignored with COM interfaces.
i.e. the custom marshaler works fine when I PInvoke a method whose
parameter is attributed with MarshalAs...

Custom Marshalers don't support value types directly; they're only
supported when they're boxed.  On the PInvoke side this means declaring
parameters and return values as Object instead of DateTime.  This might be
why it's not working with COM objects.  If I try to declare the managed
COM interfaces with Object instead of DateTime it simply causes an
exception.  So, it /appears/ as if custom marshaling of value types is not
supported on COM objects.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to