HighTechTalks DotNet Forums  

Convert IDL interface and enum into Managed C++ (C++ CLI)

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Convert IDL interface and enum into Managed C++ (C++ CLI) in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Cartoper
 
Posts: n/a

Default Convert IDL interface and enum into Managed C++ (C++ CLI) - 08-13-2007 , 09:08 AM






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();
};


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.