ExecuteMCICommand – Executing a MCI command

 Shared Function _    mciSendString(ByVal lpstrCommand As String, ByVal lpstrReturnString As _    String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As _    IntegerEnd Function' helper routine; executes a MCI command ' commandString is the command to execute' deviceAlreadyOpened must be set to true if the caller has already opened the ' deviceSub ExecuteMCICommand(ByVal commandString As String, ByVal deviceAlreadyOpened _    As Boolean)    Dim returnCode As Integer = mciSendString(commandString, vbNullString, 0, 0)    ' if the return code is not 0, an error occurred    If returnCode <> 0 Then        ' close the device if necessary        If deviceAlreadyOpened Then            commandString = "close AVIFile"            mciSendString(commandString, vbNullString, 0, 0)        End If        ' throw a custom exception        Throw New MCICommandException(returnCode)    End IfEnd Sub' helper custom exception' motes: requires the GetMCIErrorString functionClass MCICommandException    Inherits Exception    Public Sub New(ByVal errorCode As Integer)        MyBase.New(GetMCIErrorString(errorCode))    End SubEnd Class

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS