Available in the LEADTOOLS Imaging toolkit. |
ShowOpenDlg Example for C++ 5.0 and later
void CDialogs::OnShowOpenDlg()
{ HRESULT hr; int nRet; ILEADRasterDlgKrn_U *m_pRasterDlgKrn = NULL; hr = CoCreateInstance(CLSID_LEADRasterDlgKrn_U, NULL, CLSCTX_ALL, IID_ILEADRasterDlgKrn_U, (LPVOID*)&m_pRasterDlgKrn); ILEADRasterDlgFile_U *m_pRasterDlgFile = NULL; hr = CoCreateInstance(CLSID_LEADRasterDlgFile_U, NULL, CLSCTX_ALL, IID_ILEADRasterDlgFile_U, (LPVOID*)&m_pRasterDlgFile); nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR); m_pRasterDlgFile->DialogTitle = "LEADTOOLS Open dialog box"; m_pRasterDlgFile->InitialDir = "c:\\images"; m_pRasterDlgFile->FileDlgFlags = 0; m_pRasterDlgFile->EnableShowPreview = true; m_pRasterDlgFile->EnableShowLoadOptions = false; m_pRasterDlgFile->LoadRotated = false; m_pRasterDlgFile->LoadCompressed = false; m_pRasterDlgFile->LoadPasses = 0; m_pRasterDlgFile->UIFlags = OPEN_SHOW_PROGRESSIVE | OPEN_SHOW_MULTIPAGE | OPEN_SHOW_LOADROTATED | OPEN_SHOW_LOADCOMPRESSED | OPEN_SHOW_FILEINFO | OPEN_SHOW_PREVIEW | OPEN_SHOW_DELPAGE | OPEN_VIEWTOTALPAGES; nRet = m_pRasterDlgFile->ShowOpenDlg((long)m_hWnd); if (nRet == 0 && m_pRasterDlgFile->DialogStatus == DLG_OK) { m_pLead1.Load(m_pRasterDlgFile->FileName, 0, m_pRasterDlgFile->PageNumber, 1 ); } }