Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7534165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:56:19+00:00 2026-05-30T05:56:19+00:00

I am using an enum declared in the same namespace as one of my

  • 0

I am using an enum declared in the same namespace as one of my COM interfaces in C#.

When I view the enum in the function and object browser in Hyper Vee the enum is listed below the COM interface, but all the constants inside it have the enum name added as a prefix to it.

Example:

Enum = enumName
Const = enumName_constantName

where I want the Const to be only equal to constantName.

I have not seen this in VEE before, anyone knows why this is? Have I declared something wrong in my C# code?

public enum EnumName
{
    constantName1, 
    constantName2
};

public interface InterfaceName
{
}

With the result that the constants being shown in VEE are shown as EnumName_constantName1, etc…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:56:21+00:00Added an answer on May 30, 2026 at 5:56 am

    No, this is caused by a significant incompatibility between .NET enum types and the enum keyword in languages like C and C++. Those languages add the enumeration members to the global namespace. Which is actually quite a problem, it often forces you to put prefixes on the enumeration member names so they won’t collide with other identifiers. Like “constant”, as you used in your snippet.

    The recently approved new C++ language standard (C++11) actually has a fix for this problem with the new enum class keyword. Which works the same way as .NET enums, they need to be prefixed by their enum type name. Coincidentally also the exact same syntax used by C++/CLI 6 years ago. It probably wasn’t an accident.

    There isn’t anything reasonable that the type library exporter can do. But prefix the enumeration member with its type name. Just what you are seeing, “EnumName_constantName1”. Not doing this will invoke the horrors of identifier name collisions.

    But look at the bright side, you no longer have to use that ugly “constant” prefix. The client code now can use “EnumName_Name1”. If you really, really need to fix this then you could decompile the type library into .idl with the oleview.exe program. Edit the typedef and compile it back to a .tlb with midl.exe. Otherwise a painful thing to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a COM object written using the MS ATL library. I have declared
I am using fully qualified name of the enum inside a method in one
Using Q_ENUMS I can now register with Qt an enum declared inside a class
I have problem with deserialize document to object using XmlSerializer class. Code my function
I have a contant list declared in java using enum type, that must appears
I was using an enum in which the constant was a Class. I needed
I have a database table using an enum. This is already working with hibernate
In the external code that I am using there is enum: enum En {VALUE_A,
I want to convert an string to an enum type using TValue, I googled
A using declaration does not seem to work with an enum type: class Sample{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.