473,408 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Attributes to expose enum to COM?

What's the magical incantation to be able to expose an enum to COM?

namespace NThingy
{
// I want to be able to access this like an old school midl enum
public enum FileStatusCodes
{
HOLD = 0,
PENDING = 1,
COMPLETED = 2
}
// Interface...
[Guid("XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX")]
public interface IThingy
{
}
// Events...
[Guid("XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX")]
InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
public interface EThingy
{
}
// the object...
[Guid("XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX")]
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(EThingy))]
public class CThingy:IThingy
{
}
}
May 25 '07 #1
0 1728

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven Quail | last post by:
Hi to all, I have just started looking at XML.Serialization classes and would like to know how I set an attribute for an XML element. For example, I want my XML doc to look like the following:...
2
by: Gerard Stafleu | last post by:
I have a project with the following module: Module mdlDeclarations Public Enum getMethod gmFirst gmLast End Enum End Module and the following class:
1
by: Mythran | last post by:
I have an enum such as the following: Public Enum MyEnum EnumValue1 EnumValue2 EnumValue3 End Enum I have bound, at run-time, the enumeration to a combo box. The combo box now has three...
6
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
3
by: Ant | last post by:
Hi, Im wrapping a MailMessage object & need to expose the Priority property. This property is set to a value of the 'MailPriority' enum. My question is, how do I create a member that accepts this...
3
by: Nathan Sokalski | last post by:
I want to add attributes to my custom controls that are not of type String. I know how to convert from a String to the different types that I want, but when the user assigns values to the...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
0
by: John Smith | last post by:
Is there a way to get a C# enum declared inside the class to be accessible inside the COM host? Thanks, tima at predator dash software dot com
1
by: =?Utf-8?B?cHJlZGF0b3Jzdw==?= | last post by:
....just like the MIDL "enum" so I have access to this thing from the host side. Is it as simple as giving the enum a public attribute/guid? thanks! tima at predator dash software dot com
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.