Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / August 2007

Tip: Looking for answers? Try searching our database.

Moving interface & enum from IDL to C++/CLI

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cartoper - 12 Aug 2007 13:07 GMT
I am working on a project that currently has some interfaces and enums
defined in an IDL file.  The sole implementor of these interfaces are
now in C++ CLI, but I still have consumers that are in unmanaged C++.
I would like to move the interface and enum definitions to the C++ CLI
code, but I cannot figure out what shape it should take:

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();
};
Sheng Jiang[MVP] - 13 Aug 2007 23:36 GMT
you can create a type library

Signature

Sheng Jiang
Microsoft MVP in VC++

> I am working on a project that currently has some interfaces and enums
> defined in an IDL file.  The sole implementor of these interfaces are
[quoted text clipped - 43 lines]
>     property MemberTypeEnum MemberType();
> };

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.