Re: COM Interop Types

Mike Andrews <[email protected]> Wed, 24 Jun 2009 08:58:08 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
That's kinda what I was looking for.
However, I want to decorate a property with that.  Can that be done?
The property is a System.Decimal type.  MarshallAsAttribute can't be applied
to a property (or so it says).

On Wed, Jun 24, 2009 at 8:48 AM, Mattias Sjögren <[email protected]> wrote:

> [return: MarshalAs(UnmanagedType.Currency)] should expose it as a
> Currency type on the VB6 side, if that's appropriate.
>
>
> Mattias
>
> ---- Original Message ----
> From: [email protected]
> To: [email protected]
> Subject: [ADVANCED-DOTNET] COM Interop Types
> Date: Wed, 24 Jun 2009 08:08:32 -0500
>
> >I've got to make some classes in my .NET assembly COM-Callable for
> >use in an
> >old VB6 application.
> >The assembly is written in C# and I've had pretty good success so far
> >in
> >making the step towards conversion.
> >However, I've run into a particular problem:  I have a property on an
> >interface that get/sets a System.Decimal type.  But when I try to set
> >it in
> >VB6 it complains about the data type.  The error message is:
> >"Function or
> >interface marked as restricted, or the function uses an Automation
> >type not
> >supported in Visual Basic."
> >
> >Do any of you know what I can do to fix it so that it is a supported
> >type?
> >I know you can put [returns: XXXXXXXX] as an attribute but I'm not
> >sure what
> >to put there and I'm having a hard time finding any information.
> >
> >Any help would be appreciated.
> >
> >Thanks.
> >
> >===================================
> >View archives and manage your subscription(s) at http://peach.ease.ls
> >oft.com/archives
>
> ===================================
> View archives and manage your subscription(s) at
> http://peach.ease.lsoft.com/archives
>

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives