LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I open an LabView executable when a double-click on a file?

hello

I want to execute an LabView executable when the user double-click on a file which have got HIO extension. In fact, I want my application works like EXCEL, WORD : when you want to open XLS or DOC file, you double click the file and the application open if it close or open another windows.
I need the HIO file name to open it and to compute it in my application. How can I do that with labview 6.1 and the application builder?

best regards
jerome LEGRAND
0 Kudos
Message 1 of 22
(4,983 Views)
Check-out the OpenG Package Installer project. They have a bunch of tools that make this kind of association easy to do.

Visit http://ogpm.sourceforge.net/ogpi or http://www.openg.org for more information and updates to the OpenG Package Installer

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 22
(4,983 Views)
Hi there

Of course it is possible to link any file type to your labview
application by maping the needed extension to the applications
startup file (yourApp.exe). This can be done manually by
using the explorers file option dialog and the file types dialog.
By retreiving the callers command line parameter you application is
able to get the selected files path and continues its the operation.



"jerome" wrote in message
news:50650000000800000031770000-1042324653000@exchange.ni.com...
> hello
>
> I want to execute an LabView executable when the user double-click on
> a file which have got HIO extension. In fact, I want my application
> works like EXCEL, WORD : when you want to open XLS or DOC file, you
> double click the file and the application open if it
close or open
> another windows.
> I need the HIO file name to open it and to compute it in my
> application. How can I do that with labview 6.1 and the application
> builder?
>
> best regards
> jerome LEGRAND
0 Kudos
Message 3 of 22
(4,753 Views)
Thanks, Mike

Also, the package installer link should be:

http://ogpm.sourceforge.net/OGPI/
Those darned Unix machines are so case-sensitive 🙂

Also, there is another example of this in the OpenG Application Builder installer:

http://ogab.sourceforge.net

Both of these are a little tricky and use a VB Script to recieve the Windows Shell commands (This method was developed by Jean-Pierre Drolet). The VB Script, in turn, uses ActiveX to communicate with LabVIEW and pass parameters to a VI that does the real work on the file. When building an executable you will want to change the VB Script so that it accesses the ActiveX server of your executable.

Soon, we are going to try to put together a flexible tool for registering extensions with
the OS and handling files. We are ultimately going to add this feature into the OpenG Application Builder so that it can be easily added to new applications that you build.

Cheers,

Jim
0 Kudos
Message 4 of 22
(4,983 Views)
Another possibility is to invoke you application with a command-line and use WinAPI calls to get the command-line arguments. Check out this project for an example of getting the command-line that launched LabVIEW: <> You will need to register your application to recieve the command-line from the windows shell by registering your extensions, as is done in the OGAB and OGPI installers.

-Jim
0 Kudos
Message 5 of 22
(4,983 Views)
Though you might want to know, I copied and pasted the reference line from the OGPI readme file, wrong case and all...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 22
(4,810 Views)
I knew I remembered seeing that bug somewhere...

Cheers,

Jim
0 Kudos
Message 7 of 22
(4,810 Views)
The problem with the command-line method (and why I develop the ActiveX method) is that once the application is already running, it doesn't respond anymore to open file from the Explorer.


LabVIEW, C'est LabVIEW

0 Kudos
Message 8 of 22
(4,983 Views)
Jean-Pierre,

I just realized that the ActiveX mechanism when used for registering files to EXE's, does not have one problem that handling files in the LabVIEW development environment has -- multiple versions of LabVIEW competing for the "Application.LabVIEW" server name. You can explicitly define your ActiveX Server name in the application build file.

Also, I have a question. Is there a way to set-up an application to use DDE to accept shell commands when it is open? For example the "Use DDE" settings for handling the open action of "*.vi" files is:

DDE Message: open(%1)
Application: LabVIEW
DDE Application Not Running:
Topic: System

LabVIEW does still have DDE support VIs.
Is it possible for a LaBVIEW App (EXE) to programatically register a DDE Server at start-up and have a process monitoring for the shell commands? I haven't really got a clue about any of this.

-Jim
0 Kudos
Message 9 of 22
(4,983 Views)
Jim,

I have written an article about this on my web page but unfortunately, my provider had shut it down (my fault, I didn't login for months). I have attached it but the download link (within) is dead. It would be a good idea to host it somewhere in OpenG.org.

The short answer about DDE is that if you associate another file type to LabVIEW DDE Server, LabVIEW seeks in the file to figure if it is a LabVIEW file (VI file, Control file, LLB, etc) e.g. it doesn't care for the file extension, it looks at the file format. If it is a LabVIEW file, it opens it, if not, the request is discarded.

Now it would be a VERY good idea if that filename, instead of being discarded, were sent to some diagram node lik
e a primitive or the event structure. But it is not.

As for building your own DDE Server, the DDE tools in LabVIEW lack an important function, "DDE Server Execute", which is required to receive the requests. It has a "DDE Execute.vi" which can send requests to open files in other applications but has not the server equivalent to receive them.

See the attachment for more details.


LabVIEW, C'est LabVIEW

0 Kudos
Message 10 of 22
(4,983 Views)