Solved

0x00000007 conversion??

Posted on 2010-09-11
2
498 Views
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>
    <Flags()>
    Public Enum DeviceState

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

Open in new window

namespace NAudio.CoreAudioApi
{
    /// <summary>
    /// Device State
    /// </summary>
    [Flags]
    public enum DeviceState
    {
        /// <summary>
        /// DEVICE_STATE_ACTIVE
        /// </summary>
        Active = 0x00000001,
        /// <summary>
        /// DEVICE_STATE_UNPLUGGED
        /// </summary>
        Unplugged = 0x00000002,
        /// <summary>
        /// DEVICE_STATE_NOTPRESENT 
        /// </summary>
        NotPresent = 0x00000004,
        /// <summary>
        /// DEVICE_STATEMASK_ALL
        /// </summary>
        All = 0x00000007
    }
}

Open in new window

0
Comment
Question by:KristjanLaane
2 Comments
 
LVL 10

Accepted Solution

by:
james-ct16 earned 500 total points
Comment Utility
Howdy

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 http://www.codeproject.com/KB/cs/masksandflags.aspx

Discussion about enums with flasg and vb examples http://weblogs.asp.net/wim/archive/2004/04/07/109095.aspx

Hope that gets you going

James
0
 

Author Closing Comment

by:KristjanLaane
Comment Utility
thanks!!!!!!!!!!!!!!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now