Announcement

Collapse
No announcement yet.

CopyFileTo

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • CopyFileTo

    Hello,

    Ich will gerne von ein Source Verzeichniss ein Datei kopieren zum ein andere
    Verzeichniss,

    Ich habe dazu CopyFileTo versucht aber Ich bekomme immer ein Fehler :

    Call to undefined function : 'CopyFileTo'.

    Kann Ich etwas anders programmiern zum kopieren von Datei zwischen mehre Verzeichnissen?

  • #2
    http://www.bytesandmore.de/rad/cpp/snipp/sc01005.php

    PS:

    Es gibt keine Funktion CopyFileTo, außer bei den Indytools. Dann musst du die Header einbinden
    Zuletzt editiert von Christian Marquardt; 01.09.2007, 19:42.
    Christian

    Comment


    • #3
      Aber ist das eine Copy oder Move routine ?

      Comment


      • #4
        Warum suchst du nicht selber in der Hilfe?

        einfach F1 drücken, "copytofile" eingeben, lesen

        Was ist daran nicht möglich?
        Christian

        Comment


        • #5
          Vielleicht da "copytofile" keine Funktion ist welcher beschrieben ist in die Hilfe, und Ich nür "CopyFileTo" finde in dass Hilfe und die Funktion nicht funkioniert wie beschrieben ist in die Hilfe.
          Code:
          Copies the source file to the destination file.
          
          
          function CopyFileTo(const Source: string; const Destination: string): Boolean;
          
          Parameters
          
          const Source: string
          
          Source file name.
          
          
          const Destination: string
          
          Destination file name.
          
          
          Returns
          
          Boolean - True if the file is copied, False on error.
          
          
          Description
          
          CopyFileTo is a function used to copy the file specified in Source to the file specified in Destination.
          CopyFileTo will return False if the file in Destination already exists.
          CopyFileTo encapsulates the platform-specific calls needed to perform the file copy operation. On the Windows platform, this is the Win32 API function CopyFile. On the Linux platform, CopyFileTo uses a TFileStream instance to create the destination file.

          Comment


          • #6
            Schön das du einen Hilfe-Auszug kopierst aber den wichtigsten Teil vergisst.

            CopyFileTo
            Unit: IdGlobal
            Also heist das wohl das die Definition in der Unit IdGlobal vorliegt (welche eingebunden werden muss) In dieser Unit nachgesehen so wird nur CopyFile aus der Win32-API aufgerufen.

            Ich glaube du besorgst dir erst mal ein paar Bücher über Grundlagen der Programmierung C++ mit C++-Builder und arbeitest die von Borland mitgelieferten Beispiele durch.

            Comment


            • #7
              @Quadran

              Bitte vollständig lesen

              außer bei den Indytools. Dann musst du die Header einbinden

              Was ist dein Problem??

              Ich habe dir einen Link gepostet, wo du kopieren usw, kannst. Warum nutzt du diesen nicht??
              Christian

              Comment


              • #8
                Ok, Ich habe dass Programm Beispiel eingefurht, und in dass Header Datei die MoveFiles deklaniert unten "public"
                Code:
                int MoveFiles(AnsiString slSourceDir, AnsiString slTargetDir);
                dann habe Ich dass MoveFiles wie ein Funktion eingegeben in dass CPP Datei und dann angerufen genau wie in dass Beispiel.

                Aber dann bekomm Ich ein "Unresolved External" error.


                The named symbol is referenced in the given module but is not defined anywhere in the set of object files and libraries included in the link. Check to make sure the symbol is spelled correctly.
                You will usually see this error from the linker for C or C++ symbols if any of the following occur:

                You did not properly match a symbol’s declarations of __pascal and __cdecl types in different source files.
                You have omitted the name of an .OBJ file your program needs.
                You did not link in the emulation library.

                If you are linking C++ code with C modules, you might have forgotten to wrap C external declarations in extern “C”.

                You could also have a case mismatch between two symbols.
                Dass ist wass Ich in Help finde aber wass muss ich noch mehr machen dann ein definition in dass Header Datei ?

                Comment


                • #9
                  Dann hast du es offenbar falsch gemacht.

                  Ich schätze mit 99% tiger Sicherheit hast du in der CPP Datei irgendwo

                  int MoveFiles(AnsiString slSourceDir, AnsiString slTargetDir)
                  {
                  ...Programmcode
                  }

                  stehen

                  Anstatt

                  int KLASSENNAME::MoveFiles(AnsiString slSourceDir, AnsiString slTargetDir)
                  {
                  ...Programmcode
                  }

                  Wie wäre es, du informierst dich übergrundlegende Dinge in der OOP
                  Zuletzt editiert von Christian Marquardt; 03.09.2007, 07:23.
                  Christian

                  Comment


                  • #10
                    Ok, Ich habe Form2:: eingegeben und FO_COPY programmiert und jetz funkioniert dass.

                    Comment


                    • #11
                      Warum wundert das nicht......
                      Christian

                      Comment

                      Working...
                      X