Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. UnWanted Error Show

UnWanted Error Show

Scheduled Pinned Locked Moved C / C++ / MFC
help
12 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TeVc
    wrote on last edited by
    #1

    Hi All I am useing SHFileOperation.Code is here

    void CAbc::OnBnClickedButton1()
    {

    CString pzFrom=\_T("C:\\\\Test\\\\");
    CString  psTo=\_T("C:\\\\");
    CopyFolder(pzFrom, psTo);
    

    }
    void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
    {

    SHFILEOPSTRUCT fos ={0};
    fos.wFunc = FO_COPY;
    fos.pTo = pszTo;
    fos.pFrom = pszFrom;

    ::SHFileOperation(&fos);

    }

    Both Directory exits.I am geting Error this on Dailog Box

    Could not find this item

    This is no longer in C:\Test\.Verify the Item's location and try again.

    I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:

    H M R 3 Replies Last reply
    0
    • T TeVc

      Hi All I am useing SHFileOperation.Code is here

      void CAbc::OnBnClickedButton1()
      {

      CString pzFrom=\_T("C:\\\\Test\\\\");
      CString  psTo=\_T("C:\\\\");
      CopyFolder(pzFrom, psTo);
      

      }
      void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
      {

      SHFILEOPSTRUCT fos ={0};
      fos.wFunc = FO_COPY;
      fos.pTo = pszTo;
      fos.pFrom = pszFrom;

      ::SHFileOperation(&fos);

      }

      Both Directory exits.I am geting Error this on Dailog Box

      Could not find this item

      This is no longer in C:\Test\.Verify the Item's location and try again.

      I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Where's your name file in this code?

      T 1 Reply Last reply
      0
      • H Hamid Taebi

        Where's your name file in this code?

        T Offline
        T Offline
        TeVc
        wrote on last edited by
        #3

        Sorry Sir i am not geting waht you want to know from me?Plz tell me

        T 1 Reply Last reply
        0
        • T TeVc

          Sorry Sir i am not geting waht you want to know from me?Plz tell me

          T Offline
          T Offline
          TeVc
          wrote on last edited by
          #4

          Plz help me

          T 1 Reply Last reply
          0
          • T TeVc

            Plz help me

            T Offline
            T Offline
            TeVc
            wrote on last edited by
            #5

            Plz help me it's urgent sir..

            S M H 3 Replies Last reply
            0
            • T TeVc

              Plz help me it's urgent sir..

              S Offline
              S Offline
              santhoshv84
              wrote on last edited by
              #6

              Hi, There you have just specified two folders name. What happened to the file name. Because its SHFileOperation file operation..

              1 Reply Last reply
              0
              • T TeVc

                Plz help me it's urgent sir..

                M Offline
                M Offline
                Michael Schubert
                wrote on last edited by
                #7

                TeVc++ wrote:

                urgent

                For urgentz matterz plz askz CPallini. He willz helpz.

                1 Reply Last reply
                0
                • T TeVc

                  Hi All I am useing SHFileOperation.Code is here

                  void CAbc::OnBnClickedButton1()
                  {

                  CString pzFrom=\_T("C:\\\\Test\\\\");
                  CString  psTo=\_T("C:\\\\");
                  CopyFolder(pzFrom, psTo);
                  

                  }
                  void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
                  {

                  SHFILEOPSTRUCT fos ={0};
                  fos.wFunc = FO_COPY;
                  fos.pTo = pszTo;
                  fos.pFrom = pszFrom;

                  ::SHFileOperation(&fos);

                  }

                  Both Directory exits.I am geting Error this on Dailog Box

                  Could not find this item

                  This is no longer in C:\Test\.Verify the Item's location and try again.

                  I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:

                  M Offline
                  M Offline
                  Michael Schubert
                  wrote on last edited by
                  #8

                  Did you try to use flags for SHFILEOPSTRUCT, like FOF_MULTIDESTFILES ? Did you read the documentation?

                  1 Reply Last reply
                  0
                  • T TeVc

                    Plz help me it's urgent sir..

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    TeVc++ wrote:

                    Plz help me it's urgent sir..

                    Of course when you use of this phrase you must be wait for CPallini but your code is working for me:

                    SHFILEOPSTRUCT p={0};
                    p.wFunc = FO\_COPY;   
                    p.pTo   = \_T("c:\\\\");
                    p.pFrom = \_T("c:\\\\2\\\\1");
                    
                    SHFileOperation(&p);
                    

                    You got this error because you use of p.pFrom = _T("c:\\2\\"); but you must be set a name after \\

                    1 Reply Last reply
                    0
                    • T TeVc

                      Hi All I am useing SHFileOperation.Code is here

                      void CAbc::OnBnClickedButton1()
                      {

                      CString pzFrom=\_T("C:\\\\Test\\\\");
                      CString  psTo=\_T("C:\\\\");
                      CopyFolder(pzFrom, psTo);
                      

                      }
                      void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
                      {

                      SHFILEOPSTRUCT fos ={0};
                      fos.wFunc = FO_COPY;
                      fos.pTo = pszTo;
                      fos.pFrom = pszFrom;

                      ::SHFileOperation(&fos);

                      }

                      Both Directory exits.I am geting Error this on Dailog Box

                      Could not find this item

                      This is no longer in C:\Test\.Verify the Item's location and try again.

                      I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      Try this:

                      LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test\0");
                      LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1\0");

                      SHFILEOPSTRUCT fos ={0};
                      fos.wFunc = FO_COPY;
                      fos.pTo = lpTo;
                      fos.pFrom = lpFrom;

                      if(::SHFileOperation(&fos) == 0)
                      cout<<"SHFileOperation succeeded"<<endl;

                      Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                      modified on Friday, October 3, 2008 6:42 AM

                      S 1 Reply Last reply
                      0
                      • R Rajesh R Subramanian

                        Try this:

                        LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test\0");
                        LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1\0");

                        SHFILEOPSTRUCT fos ={0};
                        fos.wFunc = FO_COPY;
                        fos.pTo = lpTo;
                        fos.pFrom = lpFrom;

                        if(::SHFileOperation(&fos) == 0)
                        cout<<"SHFileOperation succeeded"<<endl;

                        Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                        modified on Friday, October 3, 2008 6:42 AM

                        S Offline
                        S Offline
                        SandipG
                        wrote on last edited by
                        #11

                        One suggestion

                        Rajesh R Subramanian wrote:

                        LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test"); LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1");

                        should end with two null characters At least document says that i don't know if it works without that :)

                        Regards, Sandip.

                        R 1 Reply Last reply
                        0
                        • S SandipG

                          One suggestion

                          Rajesh R Subramanian wrote:

                          LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test"); LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1");

                          should end with two null characters At least document says that i don't know if it works without that :)

                          Regards, Sandip.

                          R Offline
                          R Offline
                          Rajesh R Subramanian
                          wrote on last edited by
                          #12

                          Luckily, it works. But that's a good point there. I will modify my previous post.

                          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups