Type martialing (original) (raw)

Greetings and salutations. I'm posting this to a couple of .NET programming communities, in the hope that someone will have an answer to this.

I'm writing, in what I laughingly call my spare time, a personal information management system. This is in response to a similar program that I will leave unnamed, that is supposedly designed for the visually impaired, and wins the prize for "most unintuitive user interface". Anyway, this program wants to support either COM *or* .NET add-ins. Each add-in wants to be able to return an icon representing what type of data it handles, as well as an icon for each data item indicating anything from an unread message to a protected journal entry. What the icons represent is actually completely irrelevant. Of course, .NET lets you declare a parameter of type Image or, for that matter, of type Icon. How does COM handle that? Is there a way to make an Image object from an HICON cast to an UINT? Is the Image object itself COM-callable? Am I unnecessarily complicating things? Should I just give over the notion of supporting COM add-ins for anything?