jed Posted January 17, 2009 Author Report Share Posted January 17, 2009 I am having trouble using the App.MenuLaunchVI property (super secret, I think). The problem is with projects. When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number. I cannot find a way to use that string to get a reference/path to the project window in question. Right now, if I see "_ProjectWindow" at the front of the string, I handle it differently than other type of files, and just get a list of project references in memory, then pull the first one off the top (this only works because I usually only have 1 project in memory). But this is obviously a bad way to do it. any ideas? Ultimately what I am looking for is a way to get the Project Ref from a VI launched via its menu. Quote Link to comment
jed Posted January 17, 2009 Report Share Posted January 17, 2009 I am having trouble using the App.MenuLaunchVI property (super secret, I think). The problem is with projects. When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number. I cannot find a way to use that string to get a reference/path to the project window in question. Right now, if I see "_ProjectWindow" at the front of the string, I handle it differently than other type of files, and just get a list of project references in memory, then pull the first one off the top (this only works because I usually only have 1 project in memory). But this is obviously a bad way to do it. any ideas? Ultimately what I am looking for is a way to get the Project Ref from a VI launched via its menu. Quote Link to comment
Francois Normandin Posted January 17, 2009 Report Share Posted January 17, 2009 Hi Jed, it's got to be validated if the Project.Projects[] property always returns the list of project in the same order as _ProjectWindow%d... If so, this would give you the Project reference. Quote Link to comment
Francois Normandin Posted January 17, 2009 Report Share Posted January 17, 2009 Hi Jed, it's got to be validated if the Project.Projects[] property always returns the list of project in the same order as _ProjectWindow%d... If so, this would give you the Project reference. Quote Link to comment
Jim Kring Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jed @ Jan 16 2009, 11:35 AM) I am having trouble using the App.MenuLaunchVI property (super secret, I think).The problem is with projects. When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number. I cannot find a way to use that string to get a reference/path to the project window in question. Right now, if I see "_ProjectWindow" at the front of the string, I handle it differently than other type of files, and just get a list of project references in memory, then pull the first one off the top (this only works because I usually only have 1 project in memory). But this is obviously a bad way to do it. any ideas? Ultimately what I am looking for is a way to get the Project Ref from a VI launched via its menu. You can use the ActiveProject property of the MenuLaunchApp. If this is a null ref, then you know it wasn't launched from a project. Quote Link to comment
Jim Kring Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (jed @ Jan 16 2009, 11:35 AM) I am having trouble using the App.MenuLaunchVI property (super secret, I think).The problem is with projects. When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number. I cannot find a way to use that string to get a reference/path to the project window in question. Right now, if I see "_ProjectWindow" at the front of the string, I handle it differently than other type of files, and just get a list of project references in memory, then pull the first one off the top (this only works because I usually only have 1 project in memory). But this is obviously a bad way to do it. any ideas? Ultimately what I am looking for is a way to get the Project Ref from a VI launched via its menu. You can use the ActiveProject property of the MenuLaunchApp. If this is a null ref, then you know it wasn't launched from a project. Quote Link to comment
LAVA 1.0 Content Posted January 18, 2009 Report Share Posted January 18, 2009 QUOTE (jed @ Jan 16 2009, 08:35 PM) When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number.I cannot find a way to use that string to get a reference/path to the project window in question. ... QUOTE (Jim Kring @ Jan 16 2009, 09:35 PM) You can use the ActiveProject property of the MenuLaunchApp. If this is a null ref, then you know it wasn't launched from a project. These both methods are used in a chain in the OpenG builder. First th check is done on the name, then the active project is opened. Good luck, Ton Quote Link to comment
LAVA 1.0 Content Posted January 18, 2009 Report Share Posted January 18, 2009 QUOTE (jed @ Jan 16 2009, 08:35 PM) When called by a VI launched from the Tools menu of a project window, the property returns "_ProjectWindowX" where X is some number.I cannot find a way to use that string to get a reference/path to the project window in question. ... QUOTE (Jim Kring @ Jan 16 2009, 09:35 PM) You can use the ActiveProject property of the MenuLaunchApp. If this is a null ref, then you know it wasn't launched from a project. These both methods are used in a chain in the OpenG builder. First th check is done on the name, then the active project is opened. Good luck, Ton Quote Link to comment
jed Posted January 20, 2009 Author Report Share Posted January 20, 2009 Aha. Why do they return the place in the list rather than the name? Can you have two projects with the same name open at the same time? Quote Link to comment
Francois Normandin Posted January 20, 2009 Report Share Posted January 20, 2009 QUOTE (jed @ Jan 19 2009, 02:19 PM) Aha. Why do they return the place in the list rather than the name? Can you have two projects with the same name open at the same time? Can you? I wouldn't think so... probably results in a Conflict. But as Jim pointed out, if you take the App.ActiveProj instead, you can get it's name directly. Quote Link to comment
jdunham Posted January 21, 2009 Report Share Posted January 21, 2009 I was having a related problem in that I had an lvlib window open, and I still got the _ProjectWindowX value as the LaunchVI and I couldn't figure out how to distinguish this window from its project. Any ideas? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.