Including phnt in an ATL C++ project
temghost03ajfksdf opened this issue · comments
temghost03ajfksdf commented
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 inphnt_windows.h
. ATL doesn't like CINTERFACE declarations for COM objects apparently. - Put
#include <cguid.h>
before you includeatlbase.h
. This is due toINITGUID
being defined by phnt, which causes it to get excluded, but it has has some GUID declarations that ATL depends on likeGUID_NULL
which are only available asextern
s 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~ 🙃