当前位置:首页 > Windows程序 > 正文

解决使用#include setupapi.h报出错误的问题

2024-03-31 Windows程序

在使用windows驱动与应用程序进行交互时,可能会用到常用的SetupApi,SetupApi被包含在#include <setupapi.h>头文件中,如果大家直接使用这个头文件的话,会报错很多错误。

因为setupapi.h依赖这些头文件:

1 #include <windows.h> // Includes basic windows functionality. 2 #include <stdio.h> // Includes the standard i/o functions. 3 #include <string.h> // Includes the string functions. 4 #include <tchar.h> // Includes the string functions. 5 #include <setupapi.h> // Includes the SetupAPI.

另外还要调用setupapi.lib

1 // Link with SetupAPI.Lib. 2 #pragma comment (lib, "setupapi.lib")

然后就可以正常使用Setup API了。

标签:

原文地址:https://www.cnblogs.com/acmexyz/p/11647937.html

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/8984.html

Jm-杰米博客Jamie
草根站长的技术交流乐园!IT不会不要紧快来好好学习吧!
  • 20786文章总数
  • 7494585访问次数
  • 建站天数
  • 友情链接