Example #1
0
void CTobCompiler::Reset()
{
	m_line = 0;
	m_err.Empty();
	m_bin.RemoveAll();
	if(m_fsrc) { fclose(m_fsrc); m_fsrc = 0; }
	if(m_fdst) { fclose(m_fdst); m_fdst = 0; }

	POSITION p = m_defbin.GetStartPosition();
	CString str;
	CByteArray* bin;
	while(p)
	{
		m_defbin.GetNextAssoc(p, str, bin);
		delete bin;
	}
	m_defbin.RemoveAll();
	m_defbin.InitHashTable(251);

	m_label.RemoveAll();
	m_label.InitHashTable(251);
	for(int i = m_exp.GetSize() - 1; i >= 0; --i)
		delete m_exp.GetAt(i);
	m_exp.RemoveAll();
	m_change.RemoveAll();
	m_change.InitHashTable(251);
	m_bit_i = 32;
	m_bit_f = 32;
	m_maxc = -1;
	m_maxw = -1;
	m_maxs = -1;
}
static int Script_LuaServerConnect( LuaState* state )
{
	m_receivedFileMap.RemoveAll();
	theApp.GetDebuggerView()->m_currentFileName.Empty();
	theApp.GetNetworkClient().SendCommand("LuaClientConnect()");
	return 0;
}
Example #3
0
void COXAutoComplete::Detach(HWND hWnd)
{
	if (hWnd)
	{
		COXAutoStorage* pStorage;
		if (m_mpStorage.Lookup(hWnd,pStorage))
		{
			m_mpStorage.RemoveKey(hWnd);
			m_mpOptions.RemoveKey(hWnd);
		}
		else
			return;
		//try to find out who else is using this storage,
		//if no one is using, delete it
		COXAutoStorage* pTest=NULL;
		POSITION pos=m_mpStorage.GetStartPosition();

		while (pos)
		{
			HWND hwnd;
			m_mpStorage.GetNextAssoc(pos,hwnd,pTest);
			if (pTest==pStorage)
				return;
		}
		delete pStorage;
		return;
	}

	//detach all storages
	POSITION pos=m_mpStorage.GetStartPosition();
	
	//cannot delete directly because the same storage can be mapped 
	//to different windows
	CMap<COXAutoStorage*,COXAutoStorage*,DWORD,DWORD> mpToDelete;

	while (pos)
	{
		HWND hwnd;
		COXAutoStorage* pStorage=NULL;
		m_mpStorage.GetNextAssoc(pos,hwnd,pStorage);
		mpToDelete.SetAt(pStorage,NULL);	
	}

	//delete all objects
	pos=mpToDelete.GetStartPosition();
	while (pos)
	{
		COXAutoStorage* pStorage;
		DWORD dwNULL;
		mpToDelete.GetNextAssoc(pos,pStorage,dwNULL);
		delete pStorage;

	}

	mpToDelete.RemoveAll();
	m_mpStorage.RemoveAll();
	m_mpOptions.RemoveAll();
}
// Unload this application. Unregister all objects
// registered in InitApplication.
void UnloadApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_EXIT
	//}}AFX_ARX_EXIT
	
	acedRegCmds->removeGroup(_T("ADSK"));

	documentTrayMap.RemoveAll();
}
Example #5
0
/******************************************************************************
 Function Name  :   vMapCopy

 Input(s)       :   omDestMap - Destination Map object.
                    omSrcMap - Map object which should be copied.
 Output         :   -
 Functionality  :   Copies a CMap object.
 Member of      :   CMessageAttrib

 Author(s)      :   Ratnadip Choudhury
 Date Created   :   03-05-2002
******************************************************************************/
void CMessageAttrib::vMapCopy(CMap <UINT, UINT, SMsgIDAttr, SMsgIDAttr>&
                              omDestMap,
                              CMap <UINT, UINT, SMsgIDAttr, SMsgIDAttr>& omSrcMap)
{
    UINT unMsgID;
    omDestMap.RemoveAll();
    POSITION psCurrPos = omSrcMap.GetStartPosition();

    while (psCurrPos != NULL)
    {
        omSrcMap.GetNextAssoc(psCurrPos, unMsgID, m_sIDAttrTmp);
        omDestMap.SetAt(unMsgID, m_sIDAttrTmp);
    }
}
// 把选中区域转换为绝对排列字符串
CString CGraphInstrumentList::ConvertSelectAreaToAbsoluteSpreadString(CRect* pSelectAreaIndex)
{
	CString strAbsoluteSpread = "";
	CString strLine, strPoint;
	int iPointNb, iPointNbStart, iPointNbEnd;
	int iLineNb;
	CMap<int, int, CString, CString> oLineNbMap;

	for(int i = pSelectAreaIndex->top; i <= pSelectAreaIndex->bottom; i++)
	{
		// 得到图形区列索引对应的测线号
		iLineNb = GetLineNbByRowIndex(i);
		if(iLineNb > 0)	// 测线有效
		{
			iPointNbStart = GetPointNbByColumnIndex(pSelectAreaIndex->left);	// 得到起始测点
			iPointNbEnd = GetPointNbByColumnIndex(pSelectAreaIndex->right);	// 得到终止测点
			if((iPointNbStart > 0) && (iPointNbEnd > 0))	// 测点有效
			{
				if(iPointNbStart > iPointNbEnd)
				{
					iPointNb = iPointNbStart;
					iPointNbStart = iPointNbEnd;
					iPointNbEnd = iPointNb;
				}
				strPoint.Format("%d-%d", iPointNbStart, iPointNbEnd);	// 测点字符串
				strLine.Format("%d:%s;", iLineNb, strPoint);	// 测线字符串
				oLineNbMap.SetAt(iLineNb, strLine);	// 加入索引表
			}
		}
	}
	POSITION pos = oLineNbMap.GetStartPosition();
	while(NULL != pos)
	{
		oLineNbMap.GetNextAssoc(pos, iLineNb, strLine);
		strAbsoluteSpread = strAbsoluteSpread + strLine;	// 链接测线字符串
	}
	if(strAbsoluteSpread.GetLength() > 0)
	{
		strAbsoluteSpread = strAbsoluteSpread.Left(strAbsoluteSpread.GetLength() - 1);	// 去掉最后一个字符“;”
	}
	oLineNbMap.RemoveAll();
	return strAbsoluteSpread;
}