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, 13 Aug 2007 06:08:57 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Cartoper


Convert IDL interface and enum into Managed C++ (C++ CLI)   
I am working on a project that currently has the interfaces and some
enum's defined in VC6 IDL.  The only implementors (servers) of the IDL
are Managed C++/CLI, though some of the consumers (clients) are C# and
unmanaged C++.  I would like to move the interface and enum
definitions into the C++ CLI, but I cannot figure out how to handle
all the attributes, such as keeping the same uuid.  Here is an example
of what I am starting with and then what I have so far as a solution.
The solution does *NOT* work:

typedef [ uuid(4E803D49-2EB8-450a-BD00-DC8336D1E6B5) ]
enum {
    associate,
    chief,
    boss
} MemberTypeEnum;


[
object,
uuid(F1A27469-9E22-41dd-A905-F76C7DB0BE51),
dual,
nonextensible,
pointer_default(unique)
]
interface IMember : IDispatch {
    [id(1), propget] HRESULT Name([out, retval] BSTR* pRetVal);
    [id(2), propget] HRESULT Address([out, retval] BSTR* pRetVal);
    [id(3), propget] HRESULT Phone([out, retval] BSTR* pRetVal);
    [id(4), propget] HRESULT Joined([out, retval] DATE* pRetVal);
    [id(5), propget] HRESULT MemberType([out, retval] MemberTypeEnum*
pRetVal);
};

to

typedef [ uuid(4E803D49-2EB8-450a-BD00-DC8336D1E6B5) ]
enum MemberTypeEnum {
    associate,
    chief,
    boss
};

[uuid("F1A27469-9E22-41dd-A905-F76C7DB0BE51")]
public interface class IMember
{
    property String^ Name { get(); };
    property String^ Address { get(); };
    property String^ Phone { get(); };
    property DateTime Joined{ get(); };
    property MemberTypeEnum MemberType();
};
Date:Mon, 13 Aug 2007 06:08:57 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


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