Announcement

Collapse
No announcement yet.

how to invoke beyond compare through mfc c++

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

  • how to invoke beyond compare through mfc c++

    Is there a way to use Beyond compare through mfc application?

    thnx
    kings

  • #2
    Re: how to invoke beyond compare through mfc c++

    If you are talking about launching BC2, there's always the Win32 CreateProcess() call.

    If not, explain what you are trying to do.

    Comment


    • #3
      Re: how to invoke beyond compare through mfc c++

      Beyond Compare doesn't have an API.

      It is possible to write a Beyond Compare script and call it from another application.

      You can pass command line arguments into the script by using the %1, %2, etc variables in the script.

      For details see the Command Line & Scripting section of Beyond Compare's help file. Our Script Central discussion forum is also a good resource.
      Chris K Scooter Software

      Comment


      • #4
        Re: how to invoke beyond compare through mfc c++

        thnks Ernie and Chris for your information.
        I just want to use beyond compare with my application.
        I try with create process or calling a system command.

        If i still find a problem , I get back to you guys .
        thanks
        kings

        Comment


        • #5
          Re: how to invoke beyond compare through mfc c++

          I used system -its always opening the command prompt with BC. I thaught of using CreateProcess(). can you give me a simple example of it .
          because in system i simply call


          Code:
            system("\"C:\\Program Files\\Beyond Compare 2\\BC2.exe\" c:\\src.txt c:\\dest.txt");
          waiting for your reply.

          mfg
          kingsly

          Comment


          • #6
            Re: how to invoke beyond compare through mfc c++

            Sorry! to make it more precise - how to pass the two arguments in the create process.

            Code:
            if(!CreateProcess("C:\\Program Files\\Beyond Compare  2\\BC2.exe",     // Application name
                                 TEXT("c:\\src.txt c:\\dest.txt"),                 // Application arguments
                                 0,
                                 0,
                                 FALSE,
                                 CREATE_DEFAULT_ERROR_MODE,
                                 0,
                                 0,                              //   
                                 Working directory
                                 &siStartupInfo,
                                 &piProcessInfo) )
            It opens only the C:\\dest.txt file. I dont know how to give the application argument.

            thnx in advance.

            kings

            Comment


            • #7
              Re: how to invoke beyond compare through mfc c++

              You have to pass the program name, as well as the arguments:
              Code:
              if(!CreateProcess("C:\\Program Files\\Beyond Compare  2\\BC2.exe",     // Application name
                                   TEXT("\"C:\\Program Files\\Beyond Compare  2\\BC2.exe\" c:\\src.txt c:\\dest.txt"),                 // Application arguments
                                   0,
                                   0,
                                   FALSE,
                                   CREATE_DEFAULT_ERROR_MODE,
                                   0,
                                   0,                              //   
                                   Working directory
                                   &siStartupInfo,
                                   &piProcessInfo) )

              Comment


              • #8
                Re: how to invoke beyond compare through mfc c++

                Thanks Ernie..
                It works .

                Comment

                Working...
                X