[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

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

herc

8/13/2007 1:09:00 PM

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