私は VS2013 のフル バージョンを使用しており、sphelper と共に atlbase をクラスに含めようとしていますが、さまざまな種類のエラーが発生しています。
私は新しく生成されたクラスを使用しています。これは、これらのインクルージョンなしできれいにコンパイルされ、その中にはほとんど何もありません。
コンパイラはライブラリを見つけてロードしているように見えますが、約20個のエラーが発生します。これらはすべてほぼ同じです(残りは省略しましたが、これらはすべてこれらと同じです)
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atlcore.h(630): warning C4191: 'reinterpret_cast' : unsafe conversion from 'FARPROC' to 'BOOL (__cdecl *)(DWORD)'
1> Calling this function through the result pointer may cause your program to fail
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(271): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'PFNCREATETRANSACTION'
1> Calling this function through the result pointer may cause your program to fail
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(321): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'PFNCOMMITTRANSACTION'
1> Calling this function through the result pointer may cause your program to fail
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(427): error C2039: 'DeleteFile' : is not a member of '`global namespace''
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(448): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'PFNMOVEFILETRANSACTED'
1> Calling this function through the result pointer may cause your program to fail
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(460): error C2039: 'MoveFile' : is not a member of '`global namespace''
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atltransactionmanager.h(487): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'PFNGETFILEATTRIBUTESTRANSACTED'
1>E:\Programs\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\atlbase.h(5766): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'LSTATUS (__cdecl *)(HKEY,LPCWSTR,REGSAM,DWORD)'
1> Calling this function through the result pointer may cause your program to fail
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\sphelper.h(1333): warning C4191: 'type cast' : unsafe conversion from 'FARPROC' to 'LPFN_RegLoadMUIStringW'
1> Calling this function through the result pointer may cause your program to fail
これらのエラーは、atlbase.h および/または sphelper.h が含まれた後にのみ表示されます。前半は半分、後半は後半。
それらは次のように含まれています(私のプロジェクトとクラスヘッダーのインクルードの下):
#include <stdio.h>
#include <Windows.h>
#include "AllowWindowsPlatformTypes.h"
#include <atlbase.h>
#include "sphelper.h"
#include "HideWindowsPlatformTypes.h"
atlbase ライブラリと sphelper ライブラリは、任意の宣言などに関連して、それぞれ卑猥な量のエラーをスローするため、この「プラットフォーム タイプ」ブロック内にそれらを配置しています。
私はライブラリ ファイルをまったく編集しておらず、すべてのライブラリを完全に削除して、最初から再インストールしました。
私の見落としか何かが原因である可能性がありますが、atl および sphelper ライブラリが適切に含まれない理由を誰か説明できますか?
編集:
明確にするために、この問題につながった「解決」した問題の解決策を「https://answers.unrealengine.com/questions/27560/trouble-using-windows-includes-with-dword- 」で見つけました。 int.html」