Re: COM Interop Types

Mattias Sjögren <[email protected]> Wed, 24 Jun 2009 14:48:46 +0100
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
[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