Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB7
Expertise: Intermediate
May 12, 2003

GetMCIErrorString - Retrieving the description of a MCI error

<System.Runtime.InteropServices.DllImport("winmm.dll")> Shared Function _
    mciGetErrorString(ByVal dwError As Integer, _
    ByVal lpstrBuffer As System.Text.StringBuilder, ByVal uLength As Integer) _
    As Integer
End Function

' Get the description of a MCI error.
'
' ErrorCode is the code of the error
' Return a string with the description of the error.

Function GetMCIErrorString(ByVal errorCode As Integer) As String
    Dim buffer As New System.Text.StringBuilder(256)
    mciGetErrorString(errorCode, buffer, buffer.Capacity)
    Return buffer.ToString()
End Function
Alberto Falossi
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap