16,548
社区成员




typedef struct MisShowText
{
char szShowText[25];
int ShowTextID;
BYTE bState;
} MisShowText, * PMisShowText;
vector<MisShowText> m_tMSTVector;
vector<MisShowText>::iterator m_tMSTVectorIter;
BOOL CMisWnd::DelShowText(int nShowTextID)
{
Skip:
for( m_tMSTVectorIter = m_tMSTVector.begin(); m_tMSTVectorIter != m_tMSTVector.end(); m_tMSTVectorIter++ )
{
PMisShowText pstMST = m_tMSTVectorIter;-----这里出现了错误,提示如下:
if( pstMST == NULL ) return FALSE;
if( pstMST->ShowTextID == nShowTextID)
{ m_tMSTVector.erase( m_tMSTVectorIter ); goto Skip; }
}
return TRUE;
}
###################错误提示#############################################
>\wnd_mis.cpp(297): error C2440: “初始化”: 无法从“std::_Vector_iterator<_Myvec>”转换为“PMissionShowText”
1> with
1> [
1> _Myvec=std::_Vector_val<MisShowText,std::allocator<MisShowText>>
1> ]
1> 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
1> MessageWnd.cpp