本文介绍了VB2010 Express Net MidiOutOpen错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
''当我注意到我愚蠢地使用ByVal lphMidiOut而不是ByRef时,以下问题已得到解决!!!!向所有人致歉.
``我对为什么该程序失败感到困惑
''The problem described below has now been solved when I noticed I had stupidly put ByVal lphMidiOut instead of ByRef !!!! Apologies to all.
''I am baffled as to why this program fails
Imports System.Runtime.InteropServices
Public Class Form1
Declare Function midiOutOpen Lib "winmm.dll" Alias "midiOutOpen" _
(ByVal lphMidiOut As Int32, ByVal uDeviceID As Int32, _
ByVal dwCallback As Int32, ByVal dwInstance As Int32, _
ByVal dwFlags As Int32) As Int32
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
Dim lpMO As Int32
Dim rv As Int32 = midiOutOpen(lpMO, -1, 0, 0, 0)
Debug.Print(CStr(rv))
''''' the above code returns error 11 (MMSYSERR_INVALPARAM) ?? '''''
''''' -1 is the uDeviceID for the MIDI_MAPPER '''''
''''' It also fails for uDeviceID = 0 (my on-board sound card) '''''
End Sub
End Class
为什么有人知道?
''Anyone got an idea as to why?
推荐答案
这篇关于VB2010 Express Net MidiOutOpen错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!