LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Determine Which Workspaces Are Open

Solved!
Go to solution

We are currently doing some Git automation in which all developer work folders will get updated automatically. However, the automation script should skip a developer folder if CVI is open from that folder. For example, assume there are three folders.

  • c:\dev1\myproj.prj
  • c:\dev2\myproj.prj
  • c:\dev3\myproj.prj

 

If dev2 has myproj.prj open, the script will skip that folder. The way we tried to determine if a particular project is open is as follows:

1. Determine if CVI process is running.

2. If yes, get CVI window title.

 

We wrote a Win32 C++ utility for this purpose. Since the title shows the full workspace path, this information was sufficient. But recently, we noticed that if the path is too long, CVI shortens it (eg: c:\..\folder\myproj.prj). At the same time, if I hover the mouse on the title bar area, CVI shows a tool tip with the full path.

 

So I was wondering if there is any way I can read the tool tip string? Suggestions on approaching this in some other way are also welcome.

0 Kudos
Message 1 of 3
(3,846 Views)
Solution
Accepted by topic author unnikrishnan

You could use ActiveX automation to connect to a running instance of CVI to find out what the current project is.

 

Once you determine that an instannce of CVI is running, you can then call CVI_ActiveApp to connect to it (look at samples\activex\cvi\build.prj if you're not familiar with ActiveX automattion). The one caveat is that it's hard to control which instance of CVI will be used by CVI_ActiveApp, in case more than one is running. But you can always also use the CVI_AppGetCVIProcessId function to confirm that you have the right one (whatever the "right one" means, in that case).

 

Once you have a connection, then you can use CVI_AppGetCurrentProject.

 

Luis

Message 2 of 3
(3,818 Views)

Thank you. Looks like this is the best way to handle this. Will give this a try.

0 Kudos
Message 3 of 3
(3,811 Views)