Solved

0x00000007 conversion??

Posted on 2010-09-11
2
516 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

728 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