Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create Log file and how it is use Pin
Hamid_RT13-Feb-07 21:15
Hamid_RT13-Feb-07 21:15 
QuestionOFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 13-Feb-07 19:25
amitmistry_petlad 13-Feb-07 19:25 
AnswerRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Nibu babu thomas13-Feb-07 19:29
Nibu babu thomas13-Feb-07 19:29 
AnswerRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Waldermort13-Feb-07 19:33
Waldermort13-Feb-07 19:33 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 13-Feb-07 19:56
amitmistry_petlad 13-Feb-07 19:56 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz13-Feb-07 20:53
Roger Stoltz13-Feb-07 20:53 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 13-Feb-07 21:35
amitmistry_petlad 13-Feb-07 21:35 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 13-Feb-07 22:43
amitmistry_petlad 13-Feb-07 22:43 
SHFILEINFO FileInfo1;
uploadedFile = util.GetFile(NULL);

the function Getfile is below

string Utility::GetFile(HWND hWnd)
{
	try
	{
		
		OPENFILENAME ofn;
		//char* file = (char *)malloc(MAX_PATH);
		WCHAR file[MAX_PATH];
		memset(file, 0, MAX_PATH);
		ZeroMemory(&ofn, sizeof(ofn));
		ofn.lStructSize = sizeof(ofn);
		ofn.hwndOwner = hWnd;
		//ofn.lpstrFilter = _T("Media Files (*.mpeg)\0*.mpeg\0Media Files (*.wmv)\0*.wmv\0All Files (*.*)\0*.*\0\0");
		ofn.lpstrFilter = _T("Media Files (*.wmv)\0*.wmv\0All Files (*.*)\0*.*\0\0");
		ofn.lpstrFile = file;
		ofn.nMaxFile = MAX_PATH;
		ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT;
		//ofn.Flags = OFN_ALLOWMULTISELECT;
		ofn.lpstrDefExt = _T("wmv");
		WIN32_FIND_DATA data;
		GetOpenFileName(&ofn);		
		char* tempFile = new char[wcslen(file) + 1];		
		WideCharToMultiByte(CP_ACP,0,file,-1,tempFile,MAX_PATH,NULL,NULL);
		string fileName = tempFile;
		
	<code>	HANDLE hFind=NULL;    
		while(fileName.c_str()!=NULL)	
		{
			::FindNextFile(hFind,&data);
		}
       </code>



		if(tempFile != NULL)
		{
			delete[] tempFile;
			tempFile = NULL;
		}
		return fileName;
	}
	catch(exception ex)
	{
		throw ex;
	}
}


i am tring to do the red code but i dont how get the handle of the open file dialog and how toget the string which is in that handle.





Amit
AnswerRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 1:23
Roger Stoltz14-Feb-07 1:23 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 2:03
amitmistry_petlad 14-Feb-07 2:03 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 2:54
amitmistry_petlad 14-Feb-07 2:54 
AnswerRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 4:28
Roger Stoltz14-Feb-07 4:28 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 17:05
amitmistry_petlad 14-Feb-07 17:05 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 21:10
Roger Stoltz14-Feb-07 21:10 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 21:59
amitmistry_petlad 14-Feb-07 21:59 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 22:19
Roger Stoltz14-Feb-07 22:19 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 22:54
amitmistry_petlad 14-Feb-07 22:54 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz14-Feb-07 23:27
Roger Stoltz14-Feb-07 23:27 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 14-Feb-07 23:59
amitmistry_petlad 14-Feb-07 23:59 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 0:50
Roger Stoltz15-Feb-07 0:50 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 1:03
amitmistry_petlad 15-Feb-07 1:03 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 2:11
Roger Stoltz15-Feb-07 2:11 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 17:23
amitmistry_petlad 15-Feb-07 17:23 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
amitmistry_petlad 15-Feb-07 18:20
amitmistry_petlad 15-Feb-07 18:20 
GeneralRe: OFN_ALLOWMULTISELECT is not working in openfile dialog Pin
Roger Stoltz15-Feb-07 21:09
Roger Stoltz15-Feb-07 21:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.