static int l_getSheet(lua_State* L) { ExcelFile* e = toExcel(L, 1); const char* name = luaL_checkstring(L, 2); Sheet* s = e->getSheet(name); if (s) newSheet(L, s); else lua_pushnil(L); return 1; }
void CRemoveSheetDlg::OnSelchangeCombo1() { m_deleteSheetCombo.ResetContent(); CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd(); CLeftTree* pTree = (CLeftTree*)pFrame->m_wndSplitter2.GetPane(0, 0); nIndex = m_excelFileCombo.GetCurSel(); m_excelFileCombo.GetLBText(nIndex, excelFileName); char* buffer=new char[excelFileName.GetLength()+1]; WideCharToMultiByte(CP_ACP,0,excelFileName,-1,buffer,excelFileName.GetLength()+1,NULL,NULL); ExcelFile *eFile = pTree->fm.getFile(buffer); Sheet *_sheet; for(int i = 0; i < eFile->getNumOfSheets(); i++){ _sheet = eFile->getSheet(i); sheetName = _sheet->getSheetName(); m_deleteSheetCombo.AddString(sheetName); } }