/* GetData */ int InputData::GetData(long timeout #ifdef _MPI ,int rank #endif //_MPI ) { int ret = 0; if ( ds == DS_FILE ) ret = GetDataFromFile(timeout #ifdef _MPI , rank #endif //_MPI ); else if ( ds == DS_PIPE ) ret = GetDataFromFile(timeout #ifdef _MPI , rank #endif //_MPI ); else if ( ds == DS_MEM ) ret = GetDataFromMemory( #ifdef _MPI rank #endif //_MPI ); err_no = ret; return err_no; }
BOOL CEdRptDoc::GetData() { BOOL bRet = FALSE; m_FileData = 0; if ( m_nRows > 0 && m_nCols > 0) { m_nFieldCount = m_nCols; bRet = GetDataFromFile(); m_FileData = bRet ? 1 : 0; } else { bRet = GetDataFromDB(); m_FileData = bRet ? 2 : 0; } m_Grid.SetTitle(m_szTitle, m_szHeadRight, m_szFootLeft, m_szFootRight); m_Grid.SetEditable(FALSE); m_Grid.EnableDragAndDrop(FALSE); m_Grid.SetRowResize(FALSE); m_Grid.EnableSelection(FALSE); m_Grid.SetFixedRowCount(1); if (m_bFirstColFixed) m_Grid.SetFixedColumnCount(1); // set backup color for (int row = m_Grid.GetFixedRowCount(); row < m_Grid.GetRowCount(); row++) { if (row % 2 == 1) continue; for (int col = m_bFirstColFixed; col < m_Grid.GetColumnCount(); col++) m_Grid.SetItemBkColour(row, col, RGB(214, 235, 255)); } COLORREF clrBkFixed = m_Grid.GetFixedBkColor(); for (int col = 0; col < m_Grid.GetFixedColumnCount(); col++) { for (row = 0; row < m_Grid.GetRowCount(); row++) m_Grid.SetItemBkColour(row, col, clrBkFixed); } m_ColFmt.FreeExtra(); return bRet; }
int main() { std::vector<std::string> data = GetDataFromFile("data.txt"); if (data.size() == 0) { std::cout << "\nEmpty Data.txt file\n"; } else { HWND hwnd = GetDesktopWindow(); InjectToClipboard(hwnd, data[0]); Sleep(100); StartHotKey(hwnd, data); } std::cout << "\nCreate a file named \"data,txt\" and fill it with text for pasting. Seperate items with a new line[enter]\n"; system("pause"); return 0; }
CIpRuleFile::CIpRuleFile(void) { this->m_pszFilePath = _T("IpRule.dat"); InitFile(); GetDataFromFile(); }