我編譯我的DLL項目時得到這個:Unresolve外部符號
錯誤1個錯誤LNK2019:解析外部符號? 「市民:無符號字符* __thiscall CDetour :: GetThisPtr(無效)」(GetThisPtr @ CDetour @在函數「void __stdcall zCharacter_OnDamagedHook(struct ZObject *,struct D3DXVECTOR3,int,int,float,float,int)」中引用C:\ Users \Andrés函數中引用的@QAEPAEXZ) \文檔\ Visual Studio 2010的\項目\ 2k7_A-H \ 2k7_A-H \ AntiLead.obj 2k7_A-H
當我使用 「zCharacter_OnDamagedHook」 是在這裏:
void __stdcall zCharacter_OnDamagedHook(ZObject* pAttacker, D3DXVECTOR3 srcPos, int damageType, int weaponType, float fDamage, float fPiercingRatio, int nMeleeType) {
zCharacter_OnDamagedDetour.Ret(true);
std::string channelName = ZGameClient::GetInstance()->CurrentChannel;
ZCharacter* victim = (ZCharacter*)zCharacter_OnDamagedDetour.GetThisPtr();
ZCharacter* attacker = (ZCharacter*)pAttacker;
ZCharacter* me = (ZCharacter*)ZGame::GetInstance()->pMyCharacter;
if ((channelName.find("[No-Lead]") == std::string::npos) && (channelName.find("[No-Lead]") == std::string::npos)) {
ZCharacterManager* charm = ZCharacterManager::GetInstance();
if (((attacker == me) && (victim != me)) && (damageType != 5) && (damageType != 1) && (damageType != 2)) {
zCharacter_OnDamagedDetour.Ret(false);
MUID uidVictim;
for (unsigned int i = 0; i < muidList.size(); ++i) {
if (charm->Find(muidList[i]) == victim) {
uidVictim = muidList[i];
break;
}
}
MCommand* pCmd = MCommand::Create(0xD3D9);
pCmd->AddParameter(new MCommandParameterInt(uidVictim.lowId));
pCmd->AddParameter(new MCommandParameterFloat(srcPos.x));
pCmd->AddParameter(new MCommandParameterFloat(srcPos.y));
pCmd->AddParameter(new MCommandParameterFloat(srcPos.z));
pCmd->AddParameter(new MCommandParameterInt(damageType));
pCmd->AddParameter(new MCommandParameterInt(weaponType));
pCmd->AddParameter(new MCommandParameterFloat(fDamage));
pCmd->AddParameter(new MCommandParameterFloat(fPiercingRatio));
pCmd->AddParameter(new MCommandParameterInt(nMeleeType));
MCommand::Post(pCmd);
}
我真的不知道我在做什麼錯,也沒有得到這個錯誤,所以我希望有人可以幫助我,提前thranks。
'GetThisPtr()'已聲明但未定義。 – Aesthete 2012-08-06 04:06:55