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?

Jean-Pierre,

Attached is a DDE client VI that I have created to tell the LabVIEW DDE server to open a file. Creating a DDE server to handle shell reqests should be just as straight-forward. One would need to set the following Registry Keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\<.YourFileExtension> =

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\shell\open = &Open

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\shell\open\ddeexec\application =

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\shell\open\ddeexec = open(%1)

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\\shell\open\command = "" "%1"

When th
e app starts up it could use the command-line arguments, and when it is running it could use DDE.

-Jim
0 Kudos
Message 11 of 22
(1,946 Views)
Jean-Pierre,

[Re: DDE]
Is it possible to write a CIN or DLL to implement the "DDE Server Execute" feature? Is there anyway to get NI add this?

[Re: Hosting your article]
Yes, I will host it for you.

-Jim
0 Kudos
Message 12 of 22
(2,119 Views)
I sent this before your reply to my earlier post.
0 Kudos
Message 13 of 22
(1,946 Views)
Jean-Pierre,

I found this link on MSDN for creating a DDE Server and registering/executing commands:

http://msdn.microsoft.com/library/en-us/dndynex/html/msdn_ddeserv.asp?frame=true

Now all I need is a C compiler 😐

-Jim
0 Kudos
Message 14 of 22
(2,119 Views)
Jean-Pierre,

I have posted the article to:

OpenG.org >> Site Docs >> LabVIEW Articles: Guidelines to File Association and LabVIEW

http://www.openg.org/docs/guidelin.htm

-Jim
0 Kudos
Message 15 of 22
(1,946 Views)
Jim,
I have taken a look at this document when doing my research for file extension but frankly I was scared! It is huge and I have never programmed C in a Windows environment.

Maybe posting the question to CVI forum migth give some clues of how to implement such a server...


LabVIEW, C'est LabVIEW

0 Kudos
Message 16 of 22
(2,119 Views)
Thanks Jim.

Here is the companion example code. Change the link in the HTML document. That example is more convenient than peeking in OGPI or OGAB packages.


LabVIEW, C'est LabVIEW

Message 17 of 22
(1,946 Views)
0 Kudos
Message 18 of 22
(1,946 Views)
Or perhaps a posting to OGPM-Developers list 😉
0 Kudos
Message 19 of 22
(1,946 Views)
Another solution to this problem is to have a small "stub" application that only serves to catch the command-line call from the Explorer and pass the file name to the main application (launching it first if necessary).

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 20 of 22
(1,946 Views)