[GME-commit] GMESRC/SDK/BON/tools/CreateNewComponent CreateNewComponentDlg.cpp,1.5,1.6 CreateNewComponentDlg.h,1.2,1.3

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Feb 28 11:52:24 CST 2005


Update of /var/lib/gme/GMESRC/SDK/BON/tools/CreateNewComponent
In directory braindrain:/tmp/cvs-serv8003

Modified Files:
	CreateNewComponentDlg.cpp CreateNewComponentDlg.h 
Log Message:
SelectFolderDialog ( CFileDialog derived ) class doesn't work any more (since VC71).
Replaced with SHBrowseForFolder.




CVS User: zolmol

Index: CreateNewComponentDlg.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/SDK/BON/tools/CreateNewComponent/CreateNewComponentDlg.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CreateNewComponentDlg.cpp	13 Oct 2003 13:50:23 -0000	1.5
--- CreateNewComponentDlg.cpp	28 Feb 2005 17:52:15 -0000	1.6
***************
*** 189,203 ****
  
  
  
  void CCreateNewComponentDlg::OnBrowse() 
  {
  	UpdateData();
! 	CSelectFolderDialog dlgFolder( FALSE,  m_path.GetBuffer( m_path.GetLength() ), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, this );
! 	m_path.ReleaseBuffer();
! 	dlgFolder.SetTitle( _T( "Destination of Component files..." ) );
  				
!     if( dlgFolder.DoModal() == IDOK  ) {
!         m_path = dlgFolder.GetSelectedPath();
! 		UpdateData( FALSE );
! 	}
  }
--- 189,250 ----
  
  
+ CString CCreateNewComponentDlg::getDestDirectory( const CString& text = "Specify the icons directory")
+ {
+ 	BROWSEINFO bi;
+ 	TCHAR szDir[MAX_PATH];
+ 	CString Dir = "";
+ 	LPITEMIDLIST pidl;
+ 	LPMALLOC pMalloc;	
+ 	OleInitialize(NULL);
+ 	if (SUCCEEDED(SHGetMalloc(&pMalloc)))
+ 	{
+ 		ZeroMemory(&bi,sizeof(bi));
+ 		bi.hwndOwner = NULL;
+ 		bi.pszDisplayName = 0;
+ 		bi.lpszTitle = text;
+ 		bi.pidlRoot = 0;
+ 		bi.ulFlags = /*BIF_BROWSEINCLUDEFILES |*/ BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX | BIF_VALIDATE ;
+ 		bi.lpfn = NULL;
+ 		//Displays a dialog box that enables the user to select a shell folder
+ 		pidl = SHBrowseForFolder(&bi) ;
+ 		if (pidl)
+ 		{
+ 			// Converts an item identifier list to a file system path
+ 			if (!SHGetPathFromIDList(pidl,szDir))
+ 			{
+ 				pMalloc->Free(pidl) ;
+ 				pMalloc->Release() ;
+ 			}
+ 			pMalloc->Free(pidl);
+ 			pMalloc->Release();
+ 		}
+ 		else
+ 		{	// Selected 'Not to save'
+ 			return "";
+ 		}
+ 		Dir = szDir;
+ 		//Dir += "\\";
+ 	}
+ 	// end of getting directory info 
+ 	return Dir;
+ }
  
  void CCreateNewComponentDlg::OnBrowse() 
  {
  	UpdateData();
! 	//CSelectFolderDialog dlgFolder( FALSE,  m_path.GetBuffer( m_path.GetLength() ), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, this );
! 	//m_path.ReleaseBuffer();
! 	//dlgFolder.SetTitle( _T( "Destination of Component files..." ) );
  				
! 	//if( dlgFolder.DoModal() == IDOK  ) {
! 	//	m_path = dlgFolder.GetSelectedPath();
! 	//	UpdateData( FALSE );
! 	//}
! 
! 	// zolmol: CSelectFolderDialog class does not work with VC71
! 	CString n_path = getDestDirectory( "Destination of Component files..." );
! 	if( n_path != "")
! 		m_path = n_path;
! 
! 	UpdateData( FALSE );
  }

Index: CreateNewComponentDlg.h
===================================================================
RCS file: /var/lib/gme/GMESRC/SDK/BON/tools/CreateNewComponent/CreateNewComponentDlg.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CreateNewComponentDlg.h	6 Oct 2003 14:57:58 -0000	1.2
--- CreateNewComponentDlg.h	28 Feb 2005 17:52:15 -0000	1.3
***************
*** 33,36 ****
--- 33,37 ----
  // Implementation
  protected:
+ 	CString getDestDirectory( const CString& );
  	HICON m_hIcon;
  



More information about the GME-commit mailing list