0x00000007 conversion??

Posted on 2010-09-11
Last Modified: 2013-12-17
how do you finish converting the bottom code in c# to top code in vb? all is fine, but i dont know much about what these values are 0x00000007 and vb does not liek them, so im gueessign they have to be converted to integers for vb? if yes, how? if no, what values should i put in ?
Namespace NAudio.CoreAudioApi

    '/// <summary>
    '/// Device State
    '/// </summary>
    Public Enum DeviceState

        '/// <summary>
        '/// </summary>
        Active = ? '0x00000001
        '/// <summary>
        '/// </summary>
        Unplugged = ? '0x00000002
        '/// <summary>
        '/// </summary>
        NotPresent = ? '0x00000004
        '/// <summary>
        '/// </summary>
        All = ? '0x00000007
    End Enum
End Namespace

Open in new window

namespace NAudio.CoreAudioApi
    /// <summary>
    /// Device State
    /// </summary>
    public enum DeviceState
        /// <summary>
        /// </summary>
        Active = 0x00000001,
        /// <summary>
        /// </summary>
        Unplugged = 0x00000002,
        /// <summary>
        /// </summary>
        NotPresent = 0x00000004,
        /// <summary>
        /// </summary>
        All = 0x00000007

Open in new window

Question by:KristjanLaane
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Accepted Solution

james-ct16 earned 500 total points
ID: 33655217

Yes in this case you should be converting them to integers. So to answer the how part, they are hex values currently so just perform hex to base 10 conversion, in this case dead simple as it is 1,2,4,7. For further information you may like to review the following to websites for further information

Nice example of working with masks and flags

Discussion about enums with flasg and vb examples

Hope that gets you going


Author Closing Comment

ID: 33655242

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question