IInternalGameWorldPtr ptrInGameWorld = GetGameWorld(); // C4800
ptrInGameWorld->InstallLobbyClientHook(this);
產生如下錯誤:
1>e:\dgsource\dg_game\project2009\branches\alpha4\dreamgame\client\projects\gameclientshare\gamemoduleui.cpp(47): warning C4800: “IGameWorld *”: 將值強制為布爾值“true”或“false”(性能警告)
原因:GetGameWorld() 返回的 IGameWorld * 未定義;此前只是做了以下聲明:
interface IGameWorld;
但未包含 IGameWorld 的頭文件。
在文件開始處增加如下語句,警告消失:
#include "..\..\sdk\Include\GameWorld_i.h"