Ejemplo n.º 1
0
BOOL CObjectAttDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	if(m_pRecordset != NULL)
	{		
		m_lstObject.SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_INFOTIP|LVS_EX_FULLROWSELECT);
		LVCOLUMN lvColumn;
		lvColumn.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_FMT;
		lvColumn.fmt = LVCFMT_LEFT;
		
		CString strText = _T("");
		lvColumn.cx = 100;
		
		strText.LoadString(IDS_FIELD_NAME);
		OgdcString strTmp = (OgdcString)strText;
		lvColumn.pszText = (char*)strTmp.Cstr();
		
		m_lstObject.InsertColumn(0, &lvColumn);

		lvColumn.cx = 100;
		strText.LoadString(IDS_FIELD_VALUE);
		OgdcString strTmp2 = (OgdcString)strText;
		lvColumn.pszText = (char*)strTmp2.Cstr();
		m_lstObject.InsertColumn(1, &lvColumn);

		OgdcFieldInfos fieldInfos;
		m_pRecordset->GetFieldInfos(fieldInfos);
		for(int i=0;i<fieldInfos.GetSize();i++)
		{
			OgdcFieldInfo fieldInfo = fieldInfos.GetAt(i);
			OgdcString strName = fieldInfo.m_strForeignName;
			if(strName.IsEmpty())
			{
				strName = fieldInfo.m_strName;
			}
			m_lstObject.InsertItem(i, strName);
			m_lstObject.SetItemText(i, 0, fieldInfo.m_strName);
			OgdcVariant var;
			m_pRecordset->GetFieldValue(fieldInfo.m_strName, var);
			m_lstObject.SetItemText(i, 1, var.ToString());
		}
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Ejemplo n.º 2
0
void OgdcFeatureMdb::SetFieldInfos( const OgdcFieldInfos& fieldInfos )
{
	OgdcInt nCount = fieldInfos.GetSize();
	m_fieldDefines.SetSize(nCount);
	m_fieldValues.SetSize(nCount);

	OgdcFieldDefine fieldDefine;
	OgdcFieldInfo fieldInfo;
	for (OgdcInt i = 0; i < nCount; i++)
	{
		fieldInfo = fieldInfos.GetAt(i);
		fieldDefine.m_nSize = fieldInfo.m_nSize;
		fieldDefine.m_nType = fieldInfo.m_nType;
		fieldDefine.m_strName = fieldInfo.m_strName;
		m_fieldDefines.SetAt(i, fieldDefine);
	}
}