Solved

0x00000007 conversion??

Posted on 2010-09-11
2
503 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADO.NET ENTITY DATA MODEL 3 31
C# Single Form 8 28
Entity Framework 7 32
VB.net Facial recognition software (time and attendance) 6 19
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

17 Experts available now in Live!

Get 1:1 Help Now