winsiderss / phnt

Native API header files for the System Informer project.

Home Page:https://github.com/winsiderss/systeminformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Including phnt in an ATL C++ project

temghost03ajfksdf opened this issue · comments

This isn't really an issue, but more that I felt I should share my experience in hopes that it might save other people several hours of trying to make sense of Windows header files should they find themselves in a similar scenario.

By default you can't include phnt in ATL projects because of various header conflicts, such as missing declarations, etc.

So to get them to play nice, all you have to do is:

  • Comment out or remove the #define CINTERFACE lines in phnt_windows.h. ATL doesn't like CINTERFACE declarations for COM objects apparently.
  • Put #include <cguid.h> before you include atlbase.h. This is due to INITGUID being defined by phnt, which causes it to get excluded, but it has has some GUID declarations that ATL depends on like GUID_NULL which are only available as externs in this file.

Anyway, I hope this will help someone. I'm going to just close this issue since there's no problem with phnt. Thanks for your efforts~ 🙃