LONG CBenubirdAutoProxy::AddFile(LPCTSTR file) { //for default TCHAR szDefaultLib[0x100]; memset(szDefaultLib,0,0x100*sizeof(TCHAR)); g_dbDefaultLibrary.GetDefaultLibrary_For_Default(szDefaultLib); CView *pViewPtr = IsOpenedLibPath(szDefaultLib); CTFiles lTFiles; CIntArray lAddedFilesIDs; CStringList lFileNames; lFileNames.AddTail(file); CLibraryView* pView = DYNAMIC_DOWNCAST(CLibraryView, pViewPtr); int lAddedFiles = 0; lAddedFiles = pView->m_Repository.AddFiles(lFileNames); //int lAddedFiles = gRepository.AddFiles(lFileNames); pyj if (lAddedFiles > 0) { m_pDialog->InitFindText(); //? if(((CLibraryDoc*)m_pDialog->GetActiveDocument())->GetMode() == CLibraryDoc::e_ModeHome) // ((CLibraryView*)m_pDialog->GetActiveView())->Refresh(); } return lAddedFiles; }
void CBenubirdAutoProxy::Show(void) { g_strDBG.Empty(); g_strDBG.Format(_T("------------------------------------- show AutoProxy %X"),this); OutputDebugString(g_strDBG); //for default TCHAR szDefaultLib[0x100]; memset(szDefaultLib,0,0x100*sizeof(TCHAR)); g_dbDefaultLibrary.GetDefaultLibrary_For_Default(szDefaultLib); OutputDebugString(_T("------------------------ 11")); theApp.CreateLibraryView(szDefaultLib); AFX_MANAGE_STATE(AfxGetAppModuleState()); theApp.m_pMainWnd->ShowWindow(SW_SHOW); // Display the main Benubird application // ---------------------------------- // Used to bring the dialogs displayed during the right-click menu // to the foreground. For some reason, they were hiding in the background // and other methods were failing... // http://visualcpp.net/index.php?qID=52 // ---------------------------------- /* HWND hCurrWnd; int iMyTID; int iCurrTID; hCurrWnd = ::GetForegroundWindow(); iMyTID = GetCurrentThreadId(); iCurrTID = GetWindowThreadProcessId(hCurrWnd,0); AttachThreadInput(iMyTID, iCurrTID, TRUE); SetForegroundWindow(theApp.m_pMainWnd->GetSafeHwnd()); AttachThreadInput(iMyTID, iCurrTID, FALSE); */ // ---------------------------------- }