CTableInfo* pTIShow;
CColumnInfo* pTIShow_UH = NULL; void CMainFrame::SetDatabaseColumnPointers() { // Show table indexes pTIShow_UH = &(pTIShow->GetColumn(_T("UH"))); }
struct CTableInfo { CColumnInfo & GetColumn(CString name) { name.MakeLower(); CColumnNameMap::const_iterator it = names.find(name); if (it != names.end()) return columns[it->second]; return *reinterpret_cast<CColumnInfo*>(NULL); } public: CString name; typedef std::map<CString, int> CColumnNameMap; protected: typedef std::vector<CColumnInfo> CColumnInfoContainer; CColumnInfoContainer columns; CColumnNameMap names; };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)