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 8018753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:12:13+00:00 2026-06-04T21:12:13+00:00

In .Net I can (and should) apply the FlagsAttribute to enums that are used

  • 0

In .Net I can (and should) apply the FlagsAttribute to enums that are used as bitmask. This way I can use the HasFlag()-method and ReSharper doesn’t get angry if I do bitwise operations on them.

In a project I have to use an enum from a dll written in vb6 which of course does not have the FlagsAttribute. (I have seen the code, the values are bit flags.)

Eventhough VisualStudio marks it as red in code whenever I use .HasFlag(), it compiles and runs just fine. And I can “disable” the ReSharper warning on bitwise operations by always casting the enum to int (or suppress it with a comment, …)

Yet I wonder if there is a somewhat cleaner approach like marking the enum as flags once?

  • 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-06-04T21:12:14+00:00Added an answer on June 4, 2026 at 9:12 pm

    You can’t mark an external dependency – if you have a dll, whatever its source, you can’t simply change its internals (well, you can, but that would require rewriting the binary).

    One option is to write your own flags enumeration and a mapper between the VB6 one and yours and simply use your version in your code and simply ignore the issues in the mapping layer.

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

Sidebar

Related Questions

Can I teach Notepad++ that it should apply a fold whenever it sees a
See here: http://jsfiddle.net/QVhAZ/4/ How can I use * but only have it apply to
This question is specifically for .net CF, but it should apply to any slow,
I have this exact issue ASP.net can’t update page from event handler and it's
Is there any limit that application state in asp.net can store ?? Am trying
I have some experience in ASP.Net and can work my way around it without
Garbage collection in .NET leads many to believe that lightweight objects can be treated
I have a textbox in asp.net detailsview. This textbox can only take vehicle number
When we define a property like public string Name {get; set;} dot net can
.NET: How can I copy the files using Windows Copy Files dialog. I need

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.