当前位置: 首页 > news >正文

湘潭网站开发做小程序和做网站哪个好

湘潭网站开发,做小程序和做网站哪个好,网站信息化建设总体情况,在线葡京在线葡京应用程序和驱动程序的通信过程是#xff1a;应用程序使用CreateFile函数打开设备#xff0c;然后用DeviceIoControl与驱动程序进行通信#xff0c;包括读和写两种操作。还可以用ReadFile读数据用WriteFile写数据。操作完毕时用CloseHandle关闭设备。我们比较常用的就是用Dev… 应用程序和驱动程序的通信过程是应用程序使用CreateFile函数打开设备然后用DeviceIoControl与驱动程序进行通信包括读和写两种操作。还可以用ReadFile读数据用WriteFile写数据。操作完毕时用CloseHandle关闭设备。我们比较常用的就是用DeviceIoControl对设备进行读写操作。先看看DeviceIoControl是怎么定义的 BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped ); Parameters参数 hDevice CreateFile返回的设备句柄[in] Handle to the device that is to perform the operation. To obtain a device handle, call the CreateFile function.dwIoControlCode 应用程序调用驱动程序的控制命令就是IOCTL_XXX IOCTLs [in] IOCTL for the operation. This value identifies the specific operation to perform and the type of device on which to perform the operation. There are no specific values defined for the dwIoControlCode parameter. However, you can define custom IOCTL_XXX IOCTLs with the CTL_CODEmacro. You can then advertise these IOCTLs and an application can use these IOCTLs with DeviceIoControl to perform the driver-specific functions.lpInBuffer 应用程序传递给驱动程序的数据缓冲区地址[in] Long pointer to a buffer that contains the data required to perform the operation. Set to NULL if the dwIoControlCode parameter specifies an operation that does not require input data.nInBufferSize 应用程序传递给驱动程序的数据缓冲区大小字节数[in] Size, in bytes, of the buffer pointed to by lpInBuffer.lpOutBuffer 驱动程序返回给应用程序的数据缓冲区地址[out] Long pointer to a buffer that receives the output data for the operation. Set to NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.nOutBufferSize 驱动程序返回给应用程序的数据缓冲区大小字节数[out] Size, in bytes, of the buffer pointed to by lpOutBuffer.lpBytesReturned 驱动程序实际返回给应用程序的数据字节数地址[out] Long pointer to a variable that receives the size, in bytes, of the data stored in lpOutBuffer. The DeviceIoControl function may unnecessarily use this parameter. For example, if an operation does not produce data for lpOutBuffer and lpOutBuffer is NULL, the value of lpBytesReturned is meaningless.lpOverlapped 重叠操作结构[in] Ignored; set to NULL.Return Values返回值 Nonzero indicates success. Zero indicates failure. To obtain extended error information, call the GetLastError function. 非0成功0失败 具体使用我们看看列子 1向设备传递数据我们定义一个函数来实现 bool CDeviceOperDlg::SendKeyData(HANDLE handle, BYTE *bData, int iSize) {  ULONG nOutput;  BYTE bTemp[512]; //将数据放置到发送数组  memset(bTemp,0,sizeof(bTemp));  memcpy(bTemp,bData[0],iSize);  //向设备发送  if (!DeviceIoControl(handle,                 ATST2004_IOCTL_WRITE,     //根据具体的设备有相关的定义        bTemp,                                        //向设备传递的数据地址        iSize,                                            //数据大小字节数        NULL,                                          //没有返回的数据置为NULL        0,                                                  //没有返回的数据置为0 nOutput,        NULL)     )  {   return false;  } return true; } 2从设备读取数据 bool CDeviceOperDlg::ReviceKeyData(HANDLE handle, BYTE *bData, int iSize) { ULONG nOutput;  BYTE bTemp[512];  //数组清零  memset(bTemp,0,sizeof(bTemp));  //向设备发送  if (!DeviceIoControl(handle,        ATST2004_IOCTL_READ,           //根据具体的设备有相关的定义        NULL,                                              //没有向设备传递的数据置为NULL        0,                                                      //没有向设备传递的数据置为NULL        bTemp,                                           //读取设备的数据返回地址        iSize,                                               //读取数据的字节数        nOutput,        NULL)     )  {   return false;  }  //放置到公用数组  memcpy(bData[0],bTemp[0],iSize);  return true; }
http://www.pierceye.com/news/393941/

相关文章:

  • 网站正在建设中 倒计时软文写作范例大全
  • 左中右三栏布局网站建设网站建设微金手指下拉15
  • 做网站公司怎么找数字营销招聘
  • 做网站域名和空间费如何创建一个新网站
  • 前程无忧网广州网站建设类岗位wordpress建站教程视频
  • 徐州建设公司网站最吉祥的公司名字大全
  • wordpress网站前端优化怎么做网站导航地图
  • 成都市武侯区建设局门户网站自助快速建站
  • 专业视频网站开发公司兰州装修公司报价明细表
  • 企业网站管理系统的运维服务建设黑彩网站需要什么
  • 揭阳自助建站大数据就业方向及前景
  • 提供盐城网站开发dreamwearver可以做网站吗
  • 龙岩市建设局网站求大哥给个狼站2022
  • 优化算法 网站让移动网站
  • tomcat 怎么做网站网站免费推广平台
  • 山东定制型网站建设推广上传的网站打不开
  • 定制一个企业网站多少钱东莞网站竞价推广运营
  • o2o的网站有哪些制作简单网页的步骤
  • 东莞网站设计制作教程网站架构的重要性
  • 网站建设 企业观点南阳做网站aokuo
  • 深圳做网站(信科网络)减肥产品网站模板
  • 在线教育网站开发方案wordpress 内存超限
  • 网站上的网站地图怎么做中国建设银行官网开户行查询
  • 大学网站建设wordpress函数调用
  • 如何上传自己做的网站wordpress the content
  • 公司网站介绍范文dede手机网站标签
  • 彩票网站什么做公司内部网络怎么建立
  • 江苏网站备案要多久wordpress素材模板怎么用
  • 淄博网站建设有实力wordpress 异常
  • 卖汽车的网站怎么做百度图片点击变网站是怎么做的