Click here to Skip to main content
16,011,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralYou were right !!!!! Pin
ForNow19-Mar-08 17:35
ForNow19-Mar-08 17:35 
Generalurgent Pin
john563217-Mar-08 20:00
john563217-Mar-08 20:00 
GeneralRe: urgent Pin
rp_suman17-Mar-08 20:39
rp_suman17-Mar-08 20:39 
GeneralRe: urgent Pin
john563217-Mar-08 20:42
john563217-Mar-08 20:42 
GeneralRe: urgent Pin
rp_suman17-Mar-08 21:55
rp_suman17-Mar-08 21:55 
GeneralRe: urgent Pin
David Crow18-Mar-08 3:55
David Crow18-Mar-08 3:55 
GeneralRe: urgent Pin
Naveen17-Mar-08 21:21
Naveen17-Mar-08 21:21 
GeneralRe: urgent Pin
john563217-Mar-08 22:50
john563217-Mar-08 22:50 
I also tried this too and I put a messagebox to display the selected file path. But it appears only once not twice.

my code for Initialize()
<br />
<br />
HRESULT __stdcall CCoMenHandler::Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)<br />
{<br />
	//Store the PIDL.<br />
    if(pidlFolder)<br />
        m_pIDFolder = pidlFolder;<br />
	<br />
    // If Initialize has already been called, release the old<br />
    // IDataObject pointer.<br />
    if (m_pDataObj)<br />
        m_pDataObj->Release(); <br />
<br />
	 // duplicate the object pointer and registry handle<br />
   if (pdtobj)<br />
   {<br />
	   m_pDataObj = pdtobj;<br />
	   pdtobj->AddRef();<br />
   } <br />
   else<br />
   {<br />
	   return E_FAIL;<br />
   }<br />
   <br />
   //get these paths into a CStringArray<br />
   g_szSelectedFiles.RemoveAll();<br />
<br />
   //fetch all of the file names we're supposed to operate on<br />
   if (pdtobj) <br />
   {<br />
	   pdtobj->AddRef();<br />
<br />
	   STGMEDIUM medium;<br />
	   FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};<br />
<br />
	   HRESULT hr = pdtobj->GetData (&fe, &medium);<br />
	  	  <br />
	   if (FAILED (hr))<br />
	   {<br />
		   	g_bRecyleBin=TRUE;<br />
			GetRecycleBinFiles();//I could not detect the name of RecycleBin Folder on right click<br />
			return ;<br />
	   }<br />
	   else<br />
		g_bRecyleBin=FALSE;<br />
<br />
	   // buffer to receive filenames<br />
	   char path[MAX_PATH];<br />
<br />
	  	 // how many are there?<br />
	   UINT fileCount = DragQueryFile((HDROP)medium.lpszFileName, 0xFFFFFFFF,path, MAX_PATH);<br />
	  	   <br />
 	   if (fileCount>0)<br />
	   {<br />
		   // avoid wasting mem when this thing gets filled in<br />
		   g_szSelectedFiles.SetSize(fileCount);<br />
		   <br />
		   // stash the paths in our CStringArray<br />
		 for (UINT i=0;i<fileCount;i++) <br />
         {<br />
			  // clear old path<br />
			  memset(path, 0, MAX_PATH);<br />
			   // fetch new path<br />
			if (DragQueryFile((HDROP)medium.lpszFileName, i, path, MAX_PATH)) <br />
            {<br />
				g_szSelectedFiles.SetAt(i, path);<br />
AfxMessageBox(path);<br />
				<br />
				<br />
			}<br />
					      <br />
	      }<br />
         g_szSelectedFiles.FreeExtra();<br />
      }<br />
      // free our path memory - we have the info in our CStringArray<br />
      ReleaseStgMedium(&medium);<br />
   }   return S_OK;<br />
}<br />


So how could I get it.
GeneralRe: urgent Pin
Naveen17-Mar-08 23:29
Naveen17-Mar-08 23:29 
GeneralRe: urgent Pin
john563218-Mar-08 0:08
john563218-Mar-08 0:08 
GeneralRe: urgent Pin
Naveen18-Mar-08 0:19
Naveen18-Mar-08 0:19 
GeneralRe: urgent Pin
john563218-Mar-08 0:29
john563218-Mar-08 0:29 
GeneralRe: urgent Pin
fat_boy18-Mar-08 2:47
fat_boy18-Mar-08 2:47 
GeneralInheritance in Pimpl idiom Pin
George_George17-Mar-08 19:31
George_George17-Mar-08 19:31 
GeneralRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 20:01
Maxwell Chen17-Mar-08 20:01 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 22:01
George_George17-Mar-08 22:01 
AnswerRe: Inheritance in Pimpl idiom [modified] Pin
Maxwell Chen17-Mar-08 20:43
Maxwell Chen17-Mar-08 20:43 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 22:14
George_George17-Mar-08 22:14 
AnswerRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 23:00
Maxwell Chen17-Mar-08 23:00 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 23:26
George_George17-Mar-08 23:26 
GeneralRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 23:53
Maxwell Chen17-Mar-08 23:53 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George18-Mar-08 0:17
George_George18-Mar-08 0:17 
GeneralCopy File and long file path Pin
vikramlinux17-Mar-08 19:26
vikramlinux17-Mar-08 19:26 
GeneralRe: Copy File and long file path Pin
Michael Dunn17-Mar-08 19:45
sitebuilderMichael Dunn17-Mar-08 19:45 
GeneralRe: Copy File and long file path Pin
vikramlinux17-Mar-08 20:23
vikramlinux17-Mar-08 20:23 

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.