Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function Taking Generic Vector? Pin
gvanto5-Feb-09 11:44
gvanto5-Feb-09 11:44 
AnswerRe: Function Taking Generic Vector? Pin
Nishad S1-Feb-09 19:25
Nishad S1-Feb-09 19:25 
QuestionFolder Copy Pin
Davitor1-Feb-09 17:30
Davitor1-Feb-09 17:30 
AnswerRe: Folder Copy Pin
«_Superman_»1-Feb-09 17:58
professional«_Superman_»1-Feb-09 17:58 
GeneralRe: Folder Copy Pin
Davitor1-Feb-09 18:09
Davitor1-Feb-09 18:09 
QuestionRe: Folder Copy Pin
David Crow2-Feb-09 5:52
David Crow2-Feb-09 5:52 
AnswerRe: Folder Copy Pin
«_Superman_»1-Feb-09 18:12
professional«_Superman_»1-Feb-09 18:12 
AnswerRe: Folder Copy Pin
ATM@CodeProject1-Feb-09 18:52
ATM@CodeProject1-Feb-09 18:52 
Try this code

bool CMainFrame::CopyFun(LPCTSTR lpctszSrc_i,LPCTSTR lpctszDetn_i)
{


  int nSrcLen = _tcslen(lpctszSrc_i);
  int nDetnLen = _tcslen(lpctszDetn_i);

  TCHAR *pszFrom = new TCHAR[nSrcLen];
  TCHAR *pszTo   = new TCHAR[nDetnLen];

  _tcscpy(pszFrom, lpctszSrc_i);
  _tcscpy(pszTo, lpctszDetn_i);
  

  pszFrom[nSrcLen] = 0;
  pszFrom[nSrcLen+1] = 0;

  pszTo[nDetnLen] = 0;
  pszTo[nDetnLen+1] = 0;
  
  SHFILEOPSTRUCT stFileop;

  //stFileop.hwnd   = NULL;	     // no status display
  if("Copy" == m_csType )
  {
	stFileop.wFunc  = FO_COPY;   // copy operation
  }
  else
  {
	  stFileop.wFunc  = FO_MOVE; // cut operation
  }
  
  stFileop.pFrom  = pszFrom;     // source file name as double null terminated string
  stFileop.pTo    = pszTo;	     //Destination

  //stFileop.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;  // do not prompt the user
  
 
  stFileop.fAnyOperationsAborted = FALSE;
  stFileop.lpszProgressTitle     = NULL;
  stFileop.hNameMappings         = NULL;

  int ret = SHFileOperation(&stFileop);
  //delete [] pszFrom;
  //delete [] pszTo;
  
  
  return(ret == 0);

}



Here lpctszSrc_i & lpctszDetn_i are the src & detn full path.
QuestionTemplate Class: Problem with Header file Pin
gvanto1-Feb-09 13:53
gvanto1-Feb-09 13:53 
AnswerRe: Template Class: Problem with Header file Pin
«_Superman_»1-Feb-09 17:20
professional«_Superman_»1-Feb-09 17:20 
GeneralRe: Template Class: Problem with Header file Pin
gvanto1-Feb-09 17:52
gvanto1-Feb-09 17:52 
QuestionIs assignment to int atomic Pin
Dudi Avramov1-Feb-09 9:44
Dudi Avramov1-Feb-09 9:44 
AnswerRe: Is assignment to int atomic Pin
Alexander M.,1-Feb-09 9:49
Alexander M.,1-Feb-09 9:49 
QuestionRe: Is assignment to int atomic Pin
CPallini1-Feb-09 10:17
mveCPallini1-Feb-09 10:17 
AnswerRe: Is assignment to int atomic Pin
Joe Woodbury1-Feb-09 16:53
professionalJoe Woodbury1-Feb-09 16:53 
GeneralRe: Is assignment to int atomic Pin
Joe Woodbury1-Feb-09 16:52
professionalJoe Woodbury1-Feb-09 16:52 
AnswerRe: Is assignment to int atomic Pin
Randor 1-Feb-09 10:48
professional Randor 1-Feb-09 10:48 
GeneralRe: Is assignment to int atomic Pin
Dudi Avramov1-Feb-09 21:26
Dudi Avramov1-Feb-09 21:26 
GeneralRe: Is assignment to int atomic Pin
Stuart Dootson1-Feb-09 22:13
professionalStuart Dootson1-Feb-09 22:13 
Questiondecoding pdf format into device Pin
Horizzzon1-Feb-09 8:18
Horizzzon1-Feb-09 8:18 
AnswerRe: decoding pdf format into device Pin
CPallini1-Feb-09 10:23
mveCPallini1-Feb-09 10:23 
GeneralRe: decoding pdf format into device Pin
Horizzzon1-Feb-09 10:43
Horizzzon1-Feb-09 10:43 
QuestionStrncmp and GetwindowText problem Pin
keret1-Feb-09 6:18
keret1-Feb-09 6:18 
AnswerRe: Strncmp and GetwindowText problem Pin
Stephen Hewitt1-Feb-09 6:49
Stephen Hewitt1-Feb-09 6:49 
AnswerRe: Strncmp and GetwindowText problem Pin
Cedric Moonen1-Feb-09 7:31
Cedric Moonen1-Feb-09 7:31 

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.