LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling visability of 'Labview.Application' GUI via COM interface

Dear Labview users... and COM / ATL users in particular

 

I am calling the Labview Application interface (Labview.Application.7) and would like to be able to stop users from pressing the 'X' button and generally interacting with the 'Open' 'Examples'.... etc menu when it front window first appears. Is there an easy way for this? Is this something which can be controlled via COM - or from the 'Labview Options'?Or can I force Labview to start without the GUI? (e.g. something similar to run Matlab.exe /automation )

 

Once I have the Labview.VirtualInstrument interface (after opening my file.vi) it is somewhat trivial using the 'OpenFrontPanel' 'CloseFrontPanel' functions, as well as the properties for setting the visability of the 'Abort' 'Run' 'RunContinuously'. However I still have the risk that the user tries to kill the application from the front GUI with 'x' which invalidates the COM interfaces.

 

Finally is there a way to test the 'Labview.Application' interface to see if the specific file is still resided in memory?

 

It would also be useful to have some nice example code using 'late binding' methods (i.e. using IUnknown and IDispatch pointers) for successfully calling the COM interfaces, and 'GetVIReference' in particular. In the end I use the 'early' binding by importing the '.tlb' file...  (see COM andRobot.vi examples) but wasted 1/2 day on the late binding method first.

 

Thanks 

 

RS

 

0 Kudos
Message 1 of 3
(2,425 Views)

Hi Marc,

 

Sorry for the delay, I saw today that nobody write you back.
Do you still need some help?

Best regards,
Nick

0 Kudos
Message 2 of 3
(2,314 Views)

  Dear Nick et al

 

I got most of the interface working ok; and solved hiding buttons etc. So mostly ok - however when I start Labview via the ActiveX server commands it takes the focus from my application (running Irrlicht) - which then suspends itself because the window is not active. To get it to continue I need to Alt-Tab back to the main application. So if there is a way to start up labview without the main New; Open; Help window appearing it would be great; or a way to minimise it... 

 

The second problem I have is that the actuall program loads two different dll's (user specified) which create a reference to Labview. If both get loaded then no problem; but if I call pLabview->Quit() from one of them (e.g. during unload), then it kills the pointer in the other dll (actually obvious). On the other hand if I call pLabview->Release(); then the correct unlocking mechanism is used; however labview will often take between 1-5 minutes to actually exit when release count is 0. If it was possible to know how many references were open, then I could force Quit() when the last dll is unloaded. 

 

So most things are working; just minor niggles.

 

Thanks,

 

Marc

 

0 Kudos
Message 3 of 3
(2,307 Views)