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