求用VB编写的控制光驱的代码
我有C#的代码,有人能翻译过来也行,{[DllImport(@"C:\Windows\system32\winmm.dll",EntryPoint="mciSendStr...
我有C#的代码,有人能翻译过来也行,{
[DllImport(@"C:\Windows\system32\winmm.dll", EntryPoint = "mciSendString", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern unsafe int mciSendString(string lpszCommand, string lpszReturnString, System.UInt16 cchReturn, System.IntPtr hwndCallback);
public static void PopCD(IntPtr handle)
{
mciSendString("Set cdaudio door open wait", "", 0, handle);
}
public static void PushCD(IntPtr handle)
{
mciSendString("Set cdaudio door closed wait", "", 0, handle);
}
} 展开
[DllImport(@"C:\Windows\system32\winmm.dll", EntryPoint = "mciSendString", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern unsafe int mciSendString(string lpszCommand, string lpszReturnString, System.UInt16 cchReturn, System.IntPtr hwndCallback);
public static void PopCD(IntPtr handle)
{
mciSendString("Set cdaudio door open wait", "", 0, handle);
}
public static void PushCD(IntPtr handle)
{
mciSendString("Set cdaudio door closed wait", "", 0, handle);
}
} 展开
2个回答
展开全部
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
'打开光驱
mciSendString "set CDAudio door open", 0, 0, 0
'关闭光驱
mciSendString "set CDAudio door closed", 0, 0, 0
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
'打开光驱
mciSendString "set CDAudio door open", 0, 0, 0
'关闭光驱
mciSendString "set CDAudio door closed", 0, 0, 0
浙江启扬智能科技有限公司
2019-05-20 广告
2019-05-20 广告
在8位或16位嵌入式系统应用中,由于CPU资源量比较少,任务比较简单,程序员可以在应用程序中管理CPU资源,而不一定要专门的系统软件。如果嵌入式系统比较复杂并且采用32位CPU时,情况就完全不同了。32位CPU的资源量非常大,除理能力也非常...
点击进入详情页
本回答由浙江启扬智能科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询