예제 #1
0
CWnd* CuDlgIpmTabCtrl::GetPage (UINT nIDD)
{
	int index = Find (nIDD, m_arrayDlg, 0, NUMBEROFPAGES -1);
	if (index == -1)
	{
		ASSERT (FALSE); // You must define page !!
		return NULL;
	}
	else
	{
		if (m_arrayDlg[index].pPage)
			return m_arrayDlg[index].pPage;
		else
		{
			m_arrayDlg[index].pPage = ConstructPage (nIDD);
			return m_arrayDlg[index].pPage;
		}
	}
	
	for (int i=0; i<NUMBEROFPAGES; i++)
	{
		if (m_arrayDlg[i].nIDD == nIDD)
		{
			if (m_arrayDlg[i].pPage)
				return m_arrayDlg[i].pPage;
			m_arrayDlg[i].pPage = ConstructPage (nIDD);
			return m_arrayDlg[i].pPage;
		}
	}
	//
	// Call GetPage, you must define some dialog box...
	ASSERT (FALSE);
	return NULL;
}
예제 #2
0
CWnd* CConfRightDlg::GetPage (UINT nIDD)
{
	int index = Find (nIDD, m_arrayDlg, 0, NUMBEROFPAGES -1);
	//
	// Call GetPage, Did you forget to define the page in this file ???..
	ASSERT (index != -1);
	if (index == -1)
		return NULL;
	else
	{
		if (m_arrayDlg[index].pPage)
			return m_arrayDlg[index].pPage;
		else
		{
			m_arrayDlg[index].pPage = ConstructPage (nIDD);
			return m_arrayDlg[index].pPage;
		}
	}
	
	for (int i=0; i<NUMBEROFPAGES; i++)
	{
		if (m_arrayDlg[i].nIDD == nIDD)
		{
			if (m_arrayDlg[i].pPage)
				return m_arrayDlg[i].pPage;
			try
			{
				m_arrayDlg[i].pPage = ConstructPage (nIDD);
				return m_arrayDlg[i].pPage;
			}
			catch (...)
			{
				throw;
				return NULL;
			}
		}
	}
	//
	// Call GetPage, you must define some dialog box.(Form view)..
	ASSERT (FALSE);
	return NULL;
}