編譯時出錯。
出錯行:
for (iterAcceItem j = objAccelerator.p_accle_items().begin(); j != objAccelerator.p_accle_items().end(); j++)
相關代碼:
typedef vector::iterator itAccelerator;
for (itAccelerator i = m_Accelerators.begin(); i != m_Accelerators.end(); i++)
{
CAccelerator objAccelerator = (CAccelerator)*i;
if (resource_id.Compare(objAccelerator.get_tablename()) == 0)
{
typedef vector<CAcceleratorItem*>::iterator iterAcceItem;
for (iterAcceItem j = objAccelerator.p_accle_items().begin(); j != objAccelerator.p_accle_items().end(); j++)
{
CAcceleratorItem* pobjAcceleratorItem = (CAcceleratorItem*)*j;
nIndex=m_ctrl_list.InsertItem( 0,pobjAcceleratorItem->get_id());//成功則返回0
m_ctrl_list.SetItemText( nIndex, 1, pobjAcceleratorItem->get_options());
m_ctrl_list.SetItemText( nIndex, 2, pobjAcceleratorItem->get_Event());
m_ctrl_list.SetItemText( nIndex, 3, pobjAcceleratorItem->get_Type());
}
}
-------CAccelerator.h --------
#pragma once
#include "CAcceleratorItem.h"
#include "AutoProperty.h"
#include
#include "CAutoRes.h"
using namespace std;
class CAccelerator
:public CAutoRes
{
public:
CAccelerator(void);
~CAccelerator(void);
AUTO_PROPERTY(CString,tablename)
AUTO_PROPERTY(CString,prefix) //前綴 BEGIN
vector<CAcceleratorItem*> p_accle_items;
AUTO_PROPERTY(CString,postfix) //後綴 END
};
objAccelerator.p_accle_items
這個是類成員吧不是函數,p_accle_items後面括號去掉。