COM/.Net Interface?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stumpii
    Enthusiast
    • Apr 2008
    • 49

    COM/.Net Interface?

    I am pretty sure that there is no COM/.Net interface to BC3 and that the only option for controlling BC3 is via scripting. Is there any plans to add this feature in the future. I would love to be able to generate reports programmatically from another program.

    I have started looking at a .Net class library that will allow a script text file to be generated and run programmatically. Just wondering if this is something that people would be interested in and possibly helping me with. My aim at the moment is to allow a program to print folder and file compares directly to the printer, or to pdf.

    Thanks,

    Steve
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Hello,

    Part of the scripting command line allows the user to pass in variables, for example:
    bcompare.exe @"c:\script.txt" "c:\myfile1.txt" "c:\myfile2.txt" "c:\report.txt"

    These variables can then be referenced in the script.txt file as %1, %2, and %3
    There is additional information in the Help file under the Scripting Reference section, and under the Using Beyond Compare -> Automating with Script section.
    http://www.scootersoftware.com/help/...reference.html

    How do these suggestions help you?
    Aaron P Scooter Software

    Comment

    • Stumpii
      Enthusiast
      • Apr 2008
      • 49

      #3
      That's how I am doing it at the moment with one program. I have four dummy scripts that do different compares and then pass in the variables. In my program I call BC as you showed.

      For another program that will perform a similar function, but I want more control on the options of the script (like sometimes landscape, sometimes portrait), which means writing the script file at runtime and then executing it.

      I am going to start out with something simple, just printing file and folder compares. Hopfully others may help. I will put on SourceForge/Codeplex if there is enough interest,

      Thanks,

      Steve

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16026

        #4
        Thanks for your interest, Steve.

        If you have any questions, would like to show us what you have, or would like any tips/tricks about script, please let us know.

        For example, the order of commands can be important for optimization. The Load command will always trigger the current comparison criteria, so it is important to set the Criteria command before the Load command if you want to be efficient. Same is true for setting the Filter command before the Load command.
        Aaron P Scooter Software

        Comment

        • Stumpii
          Enthusiast
          • Apr 2008
          • 49

          #5
          This is what I have so far, so you get an idea of what it will do. You basically build the script options through code and then execute the script at the end.

          Code:
                      BCControl.Clear();
                      BCControl.LoadPaths(@"C:\temp\1",@"C:\Temp\2");
                      BCControl.ExpandAll();
                      BCControl.FolderReport( BCControl.FolderReportLayout.side_by_side, new CommonPrinterReportArgs("My Title", CommonPrinterReportArgs.ColourOptions.print_color));
                                                 
                      BCControl.Execute();

          Comment

          Working...