Solved

0x00000007 conversion??

Posted on 2010-09-11
2
511 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
ID: 33655217
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
ID: 33655242
thanks!!!!!!!!!!!!!!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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