在使用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了。

相关文章:

  • 2022-12-23
  • 2021-09-04
  • 2021-08-11
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2021-11-10
  • 2021-09-16
  • 2023-03-11
  • 2021-06-22
  • 2022-12-23
  • 2021-10-27
相关资源
相似解决方案