DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 23 Jul 2007 19:32:01 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Juan Dent am


How to use generics in an interface?   
Hi,

I have an interface that uses generics in its methods:

    [ComVisible(false)]
    public interface IGenericProperty
    {
        bool GetProperty<T>(string propName, out T value);  
    }

I have marked it [ComVisible(false)] because COM can't handle generics.
However the class that implements it is inside an assembly that is built 
with COM Interop On, because it implements both COM usable interfaces and 
pure .NET interfaces like the one above.

However, it gives me warnings at compile time  (more exactly at Interop 
registration time) even if I place the same attribute (ComVisible(false)) to 
the implementing methods. It seems once the class is seen as COM-consumable, 
it tries to export to COM all the interfaces it implements, like:

	[ClassInterface(ClassInterfaceType.None)]
	[Guid("33D64EF2-5CA7-49F2-A5D8-EC3E2E95BAC9")] 
    public class PersistentObject : IPersistentObject, IGenericProperty


What can I do to better mix and have the best of both worlds (especially the 
best of .NET)?

-- 
Thanks in advance,

Juan Dent, M.Sc.
Date:Mon, 23 Jul 2007 19:32:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us