求大神vb6.0代码转vb.NET
PublicDeclareFunctionwaveInGetDevCapsLib"Winmm.dll"Alias"waveInGetDevCapsA"(ByValuDev...
Public Declare Function waveInGetDevCaps Lib "Winmm.dll" Alias "waveInGetDevCapsA" (ByVal uDeviceID As Long, lpCaps As Waveoutcaps, ByVal uSize As Long) As Long
Public Type Waveoutcaps
Wmid As Integer
Wpid As Integer
Vdrivervesion As Long
Szpname As String * 64
Dwformats As Long
Wchannels As Integer
Dwsupport As Long
End Type
Public Function getInputDevName() As String
Dim Conse As Long
Dim Returncaps As Waveoutcaps
Dim Pname As String * 64
Pname = "_ERROR_"
Conse = waveInGetDevCaps(0, Returncaps, Len(Returncaps))
If Conse = MMSYSERR_NOERROR Then
Pname = Left$(Returncaps.Szpname, InStr(Returncaps.Szpname, Chr$(0)) - 1)
End If
getInputDevName = Pname
End Function 展开
Public Type Waveoutcaps
Wmid As Integer
Wpid As Integer
Vdrivervesion As Long
Szpname As String * 64
Dwformats As Long
Wchannels As Integer
Dwsupport As Long
End Type
Public Function getInputDevName() As String
Dim Conse As Long
Dim Returncaps As Waveoutcaps
Dim Pname As String * 64
Pname = "_ERROR_"
Conse = waveInGetDevCaps(0, Returncaps, Len(Returncaps))
If Conse = MMSYSERR_NOERROR Then
Pname = Left$(Returncaps.Szpname, InStr(Returncaps.Szpname, Chr$(0)) - 1)
End If
getInputDevName = Pname
End Function 展开
1个回答
展开全部
PrivateSubCommand1_Click()OnErrorGoTodeleteError'假如中间有出错,直接跳转到最后面deleteError:再继续往下执行'判断是否选择了表中的一行IfAdodc1.Recordset.EOF=TrueOrAdodc1.Recordset.BOF=TrueThen'假如在最后一条记录之后或在第一条记录之前,说明没有选中表中的某一行MsgBox"请选择要显示的行"ExitSub'没有选中内容,就退出过程,不再执行下面的删除功能EndIfDimbookTypeIdAsIntegerDimdeleteSqlAsStringbookTypeId=Me.Adodc1.Recordset.Fields(0)'得到当有选中记录的第一个字段,估计是图书类型vbResult=MsgBox("真的决定要删除当前的记录信息吗?",vbOKCancel)'询问是否真的要删除选中的记录,得到一返回值IfvbResult=vbOKThendeleteSql="deletefromBookTypewherebookTypeId="&bookTypeId'sql语句,作用为在记录集中找到前面得到的图书类型编号,并进行删除的操作语句Callcheck_condatabasecn.Execute(deleteSql)'执行删除操作,真的开始删除了MsgBox"图书类型删除成功!"EndIfMe.Adodc1.Refresh'将记录集进行更新,变为删除后的记录集Me.DataGrid1.ReBind'将绑定表格的内容显示为记录删除后的内容GoToEndSubdeleteError:MsgBox"图书类型删除失败!"EndSub:EndSub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询