阅读:1082回复:2
OpenByInterface调用问题
ds help上的帮助:
Using Device Interfaces from Application Level DriverWorks provides two classes for application level support of device interfaces: CDeviceInterfaceClass and CDeviceInterface. These classes are declared and implemented in file devintf.h, which resides in subdirectory .\\include of the DriverWorks installation. Class CDeviceInterfaceClass wraps a device information set containing information about all device interfaces of a particular class. An application can use an instance of CDeviceInterfaceClass to obtain one or more instances of CDeviceInterface. Class CDeviceInterface abstracts a single device interface. Its member function DevicePath() returns a pointer to a pathname, which can be passed to CreateFile to open the device. Here is a small sample showing the most basic usage of these classes: extern GUID TestGuid; HANDLE OpenByInterface( GUID* pClassGuid, DWORD instance, PDWORD pError ) { CDeviceInterfaceClass DevClass(pClassGuid, pError); if (*pError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; CDeviceInterface DevInterface(&DevClass, instance, pError); if (*pError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; cout << \"The device path is \" << DevInterface.DevicePath() << endl; HANDLE hDev; hDev = CreateFile( DevInterface.DevicePath(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if (hDev == INVALID_HANDLE_VALUE) *pError = GetLastError(); return hDev; } 这个东东怎么用啊! 编译后报错: Command line error D2021 : invalid numeric argument \'/Wp64\' 什么意思啊! 这个东东还不会用了,大虾帮一下了 |
|
|
沙发#
发布于:2002-12-04 16:55
这不是CODE的问题,好象是编译命令的参数问题啊。
|
|
|
板凳#
发布于:2002-12-04 16:59
什么意思啊!不太明白,我现在要调试ds提供的hidmouse这个example,我想让它每隔一段时间发一个消息,也就是虚拟鼠标的移动,我要定义什么样的函数啊?
|
|
|