Announcement

Collapse
No announcement yet.

Is there any way to detect programmatically when a Tab is closed in BC4. 

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

  • Is there any way to detect programmatically when a Tab is closed in BC4. 

    Is there any way to detect programmatically when a Tab is closed in BC4.

    We have a project where we leverage the BComp.exe to open up several comparisons, each one opens up in a separate tab. We then proceed to merge from one file to the other, save and close. I would like to detect when a tab is close instead of having to wait for the whole application to be closed to continue the logic of the program.

  • #2
    Hello,

    How are you executing BComp.exe specifically? Normally if you call bcomp.exe file1 file2, it will launch that compare and wait until that window alone is dismissed before it will allow the next window. This would sequentially call the windows (one at a time) and return as each is closed.
    Aaron P Scooter Software

    Comment


    • #3
      Hello Aaron, I work with Steve, he created this for me because I was unable to confirm my email address to post.

      Here are the details:

      we are opening BC using a session.

      executing

      BComp.exe <sessionName>

      BComp.exe opens for a second, launches BCompare.exe, and then closes.

      I tested out launching BComp.exe file1 file2 and you are correct the BComp.exe sticks around until the tab is closed
      Last edited by DennysO; 06-Feb-2020, 01:30 PM.

      Comment


      • #4
        I believe there might be some bug, when opening large amounts of comparisons the BComp.exe does not close.

        I ran this powershell script:

        Code:
        foreach ($num in 1..10) {
            .\BComp.exe "1.txt" "2.txt"
        }
        to open 10 BC Tabs. This led to 10 BComp.exe in task manager.

        Then I closed them 1 by 1 and only the first couple BComp.exe closed, the rest of them stayed open until the last tab was closed.

        Comment


        • #5
          Additional testing, If I add a 1 second sleep between opening of the tabs

          Code:
          foreach ($num in 1..10) {
              .\BComp.exe "1.txt" "2.txt"
              Start-Sleep -Seconds 1
          }
          it works properly and closes the BComp.exe process on closing of each tab.
          Last edited by DennysO; 06-Feb-2020, 12:42 PM.

          Comment


          • #6
            Hello,

            Testing with your powershell script, I'm not running into the same issues, but adding a sleep would indicate it might be timing related. I'll check with another computer to see if it can help.

            In the meantime, just to double check: are you running BC 4.3.3 64bit on Windows 10 (latest updates)? If not, what are you running and can you update to 4.3.3 (all 4.x updates are free for 4.x users)?
            Aaron P Scooter Software

            Comment


            • #7
              I've duplicated the bcomp.exe not exiting bug on my work PC using your example PowerShell script. It appears to be timing related. I'll add it to our bug list to be fixed.
              Chris K Scooter Software

              Comment


              • #8
                Originally posted by Aaron View Post
                Hello,

                Testing with your powershell script, I'm not running into the same issues, but adding a sleep would indicate it might be timing related. I'll check with another computer to see if it can help.

                In the meantime, just to double check: are you running BC 4.3.3 64bit on Windows 10 (latest updates)? If not, what are you running and can you update to 4.3.3 (all 4.x updates are free for 4.x users)?
                Arron, I tried it on 4.2.9 and 4.2.10 I haven't updated yet to 4.3.3 but I will test it now, although as per Chris' comment it looks like he was able to reproduce it on the latest version.

                ​​​​​
                Originally posted by Chris View Post
                I've duplicated the bcomp.exe not exiting bug on my work PC using your example PowerShell script. It appears to be timing related. I'll add it to our bug list to be fixed.
                Chris, thank you for confirming, I found that 600 ms is the least amount of sleep I was able to get without running into the issue, but it might be PC specific timing, I will be leveraging it until it is fixed.

                On a different note, any comments on the BComp session opening not waiting for window to close?

                Comment


                • #9
                  Yes, I duplicated it with version 4.3.3.

                  If you use bcomp.exe, it will open all tabs immediately. If you use bcomp.com, the next tab won't open until the previous tab is closed.

                  From the help file's Command Line Reference:

                  bcomp.exe: This is a Win32 GUI program. If launched from a version control system, it should work just fine. If launched from a console window, the console (or batch file) will not wait for it.

                  bcomp.com: This is a Win32 console program. It has to have a console. If you launch it from one (or a batch file) that console will wait for the comparison to complete before returning. If you launch it from a version control system interactively, it will show a console window while it's waiting.
                  Chris K Scooter Software

                  Comment

                  Working...
                  X