Jump to content

Menu Launch vi and projects


Recommended Posts

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

QUOTE (jed @ Jan 16 2009, 08:35 PM)

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

Link to comment

QUOTE (jed @ Jan 16 2009, 08:35 PM)

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.