2011-11-11 62 views
1

,當我在VS 2003編譯耳鼻喉科我得到這些錯誤錯誤C2593:「運算符=」不明確

C:\SRC\Program\_Interface\FuncTextCmd.cpp(953): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(958): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(963): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(968): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(973): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(978): error C2593: 'operator =' is ambiguous 
C:\SRC\Program\_Interface\FuncTextCmd.cpp(982): error C2593: 'operator =' is ambiguous 

這是FuncTextCmd.cpp的這一部分它引用

BOOL TextCmd_CHANGEGLOW(CScanner& scanner) 
{//98 
#ifdef __WORLDSERVER 
CUser* pUser = (CUser*)scanner.dwValue; 
scanner.GetToken(); 
CString strcr = scanner.Token; 
CString CHANGEGLOW; 


if(2 <= strcr.GetLength() && strcr.GetLength() <= 7) 
{ 
strcr.MakeLower(); 

if(strcmp(strcr, "RED") == 0) 
{ 
CHANGEGLOW = 1;//line 953 
} 
else 
if(strcmp(strcr, "BLUE") == 0) 
{ 
CHANGEGLOW = 2;//line 958 
} 
else 
if(strcmp(strcr, "GREEN") == 0) 
{ 
CHANGEGLOW = 3;//line 963 
} 
else 
if(strcmp(strcr, "YELLOW") == 0) 
{ 
CHANGEGLOW = 4;//line 968 
} 
else 
if(strcmp(strcr, "ORANGE") == 0) 
{ 
CHANGEGLOW = 5;//line 973 
} 
else 
if(strcmp(strcr, "PINK") == 0) 
{ 
CHANGEGLOW = 6;//line 978 
} 
else if(strcmp(strcr, "PURPLE") == 0) 
{ 
CHANGEGLOW = 7;//line 982 
} 
else 
{ 
strcr += "unknown glow"; 
pUser->AddText(strcr); 
return FALSE; 
} 
} 
else 
{ 
strcr += "unknown glow"; 
pUser->AddText(strcr); 
return FALSE; 

}//2 

#endif // __WORLDSERVER 
return TRUE; 
} 

這是對於遊戲的方式是在C++中

如果用戶鍵入稱,在聊天框的顏色,然後繞在自己身上的光芒會改變他們鍵入的內容的一部分以上說法,但,這僅僅是指令的主要部分這個fe ATURE在Mover.cpp處理我源然後輝光部分可以在下面

void CMover::CreateAbilityOption_SetItemSFX(int nAbilityOption) 
{ 
extern DWORD CHANGEGLOW; 
DWORD dwSfx = 0; 

switch(nAbilityOption) 
{ 
case 3: dwSfx = XI_GEN_ITEM_SETITEM03; break; 
case 4: dwSfx = XI_GEN_ITEM_SETITEM04; break; 
case 5: dwSfx = XI_GEN_ITEM_SETITEM05; break; 
case 6: dwSfx = XI_GEN_ITEM_SETITEM06; break; 
case 7: dwSfx = XI_GEN_ITEM_SETITEM07; break; 
case 8: dwSfx = XI_GEN_ITEM_SETITEM08; break; 
case 9: dwSfx = XI_GEN_ITEM_SETITEM09; break; 
case 10: dwSfx = CHANGEGLOW; break; 
} 

switch(CHANGEGLOW) 
{ 
case 1: dwSfx = RED; break; //make sure that the uppercase RED is what 
//you defined in defineobj.h 
case 2: dwSfx = BLUE; break; //make sure that the uppercase BLUE is what 
// you defined //in defineobj.h 
case 3: dwSfx = GREEN; break; //make sure that the uppercase GREEN is what you 
//defined in defineobj.h 
case 4: dwSfx = YELLOW; break; //make sure that the uppercase YELLOW is what you 
//defined in defineobj.h 
case 5: dwSfx = ORANGE; break; //make sure that the uppercase ORANGE is what you 
//defined in defineobj.h 
case 6: dwSfx = PINK; break; //make sure that the uppercase PINK is what you 
//defined in defineobj.h 
case 7: dwSfx = PURPLE; break; //make sure that the uppercase PURPLE is what you 
//defined in defineobj.h 
} 

//else 
//case 10: dwSfx = XI_GEN_ITEM_SETITEM10; break; 


CSfxPartsLinkShoulder* pSfx = NULL; 
D3DXVECTOR3 v3Scal = D3DXVECTOR3(1.0f, 1.0f, 1.0f); 


if(nAbilityOption == 3) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
/* 
else 
if(nAbilityOption == 4) 
{ 
    // ¸öÅë 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 6; 
    pSfx->SetScale(D3DXVECTOR3(2.2f, 2.2f, 2.2f)); 
} 
*/ 
else 
if(nAbilityOption == 4) 
{ 
    // ¸öÅë 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 6; 
    pSfx->SetScale(D3DXVECTOR3(3.0f, 3.0f, 3.0f)); 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 5) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 6) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // Æȸñ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 2; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 3;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 7) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // Æȸñ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 2; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 3;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¼Õ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 8;   
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 8) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // Æȸñ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 2; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 3;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¼Õ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 8;   
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 

    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;   
    pSfx->m_v3Offset.y = 0.2f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 9) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // Æȸñ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 2; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 3;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¼Õ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 8;   
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;  
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¹ß 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 26;  
    pSfx->SetScale(D3DXVECTOR3(1.5f, 1.5f, 1.5f));   
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 29; 
    pSfx->SetScale(D3DXVECTOR3(1.5f, 1.5f, 1.5f)); 
    pSfx->m_nOldAbilityOption = nAbilityOption; 


    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;   
    pSfx->m_v3Offset.y = 0.2f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
else 
if(nAbilityOption == 10) 
{ 
    // ¾î±ú 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 0; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 1; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¾î±ú, Æȸñ Áß°£ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 4;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 5; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¸öÅë 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 6; 
    pSfx->SetScale(D3DXVECTOR3(3.0f, 4.5f, 3.0f)); 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 7;  
    pSfx->SetScale(D3DXVECTOR3(3.0f, 3.0f, 3.0f));   
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¼Õ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 8;   
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9; 
    pSfx->m_v3Offset.y = 0.1f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // Æȸñ 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 2; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 3;  
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    // ¹ß 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 26;    
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 29; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 


    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 8;   
    pSfx->m_v3Offset.y = 0.2f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
    pSfx = (CSfxPartsLinkShoulder*)CreateSfx(D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1); 
    pSfx->m_nPartsLink = 9;   
    pSfx->m_v3Offset.y = 0.2f; 
    pSfx->m_nOldAbilityOption = nAbilityOption; 
} 
} 

#endif //__CLIENT 
+1

你想分配一個整數到'CString'? –

+2

縮進請。 –

回答

3

在第一代碼片段,你定義CHANGEGLOW是一個CString,然後指定一個數字。這並不奇怪,這是行不通的。鑑於在第二個片段,你宣佈它爲DWORD我想這就是你真正想要的。所以修正可能只是在該定義中將CString更改爲DWORD。其實,可能extern DWORD因爲否則它是一個局部變量的功能和分配它不會有任何持久的影響。

其實我不知道爲什麼你在本地申報。既然你不能在全局中重用標識符,並且必須在全局的某個地方定義它,那麼是否有任何理由在文件的開頭沒有全局聲明(或者更好的情況是在某個頭文件中)?

+0

確實我將其更改爲extern並且編譯時沒有錯誤,謝謝By The Way有人會看到他們如何改進代碼帖子如果可以 – 420Twisted1

+0

@ 420Twisted1:我現在注意到的一件事是您調用'MakeLower'在'strcr'上,然後將其與全大寫字符串進行比較。我很確定它永遠不會匹配一個... – celtschk

+0

@ 420Twisted1:另一件事:鑑於CHANGEGLOW上的開關是連續的數字,我認爲使用數組和索引它會更好(即'DWORD顏色= {RED,BLUE,GREEN,...};'然後代替開關(在適當的範圍測試之後,當然)只是'dwFsx = colors [CHANGEGLOW-1];' – celtschk

1

可以看出你試圖數值常量(1,2,3等)分配給CString類型的變量。即使編譯完成,對我來說這似乎是一個壞主意。也許你想要一個不同的變量類型,例如int?鑑於你稍後將switch的價值,它看起來像你想要某種數字類型,無論如何...

0

您的類型是錯誤的FuncTextCmd.cpp。你有

CString CHANGEGLOW; 

當它應該是

DWORD CHANGEGLOW; 
+0

感謝您的回覆 – 420Twisted1