ShowDirectoryDlg Example for C++ 5.0 and later

void CDialogs::OnShowDirectoryDlg()
{
	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->Directory= "D:\\Images\\Vista\\";
	m_pRasterDlgFile->Filter= "ALL|*.*|LEAD|*.cmp|JPEG|*.JPG";
	m_pRasterDlgFile->DialogTitle = "Select a Directory Please";

	nRet= m_pRasterDlgFile->ShowDirectoryDlg((long)m_hWnd); 
	if (nRet == 0 && m_pRasterDlgFile->DialogStatus == DLG_OK) 
	{
		MessageBox(m_pRasterDlgFile->Directory); 
	}
}