### 微软亚洲技术中心的高手们,请解决:如何在VB中调用VC++写的VXD? ### -...

来源:百度文库 编辑:神马文学网 时间:2024/05/02 02:42:41
这样的,现在有一个读取硬盘序列号的VXD,具体怎样调用呢?

我现在知道了使用DeviceIOControl   API,其声明为:
Declare   Function   DeviceIoControl   Lib   "kernel32 "   Alias   "DeviceIoControl "   (ByVal   hDevice   As   Long,   ByVal   dwIoControlCode   As   Long,   lpInBuffer   As   Any,   ByVal   nInBufferSize   As   Long,   lpOutBuffer   As   Any,   ByVal   nOutBufferSize   As   Long,   lpBytesReturned   As   Long,   lpOverlapped   As   OVERLAPPED)   As   Long

其中的hDevice怎样获取?

谢谢。
  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
精华推荐:【热烈祝贺】陈锐、杨永刚2008年10月当选微软MVP
  • acptvb
  • (微软全球技术中心 VB技术支持)
  • 等 级:
#4楼 得分:0回复于:2001-08-30 17:21:30 以下是从MSDN中摘录的一段

Input   and   Output   Control   in   Applications

You   use   the   device   IOCTL   interface   in   an   application   to   carry   out   "low-level "   operations   that   are   not   supported   by   the   Win32   API   and   that   require   direct   communication   with   a   VxD.   Windows   95/98/Me   implements   the   interface   through   the   DeviceIoControl   function,   which   sends   commands   and   accompanying   data   directly   to   the   given   VxD.   To   use   the   interface,   you   open   the   VxD   by   using   the   CreateFile   function,   send   commands   to   the   VxD   by   using   DeviceIoControl,   and   finally   close   the   VxD   by   using   the   CloseHandle   function.  

For   more   information,   see   the   following   topics:  

Opening   the   VxD  
Sending   Commands  
Closing   a   VxD  

具体的内容可以参考


-微软亚洲技术中心   VB技术支持

本贴子仅供CSDN的用户作为参考信息使用。其内容不具备任何法律保障。您需要考虑到并承担使用此信息可能带来的风险。具体事项可参见使用条款   (http://www.csdn.net/microsoft/terms.shtm)。