08-18-2009 04:42 AM
Hi all,
I was reading an old thread about this issue:
http://forums.ni.com/ni/board/message?board.id=170&thread.id=116925
I need to try to do this. My application uses a custom file extension (i.e. .abc). Upon installation I would like to:
1. Assign My App and custom icon to the file class (extension .abc).
This could be done by manipluting the registry (http://msdn.microsoft.com/en-us/library/bb776856(VS.85).aspx)? This could be a problem with Vista s unless registry operations occur during installation any changes are placed in a VirtualStore, correct?
2. Enable the double-clicking of .abc file type to pass the data in the file to my VI (exe).
According to the File Handling Guidelines of Jean-Pierre Drolet (http://www.openg.org/tiki/tiki-index.php?page=File+Handling+Guidelines) the best way to do this may be using LabVIEW as an ActiveX server.
I know that when I build an executable (or installer?) there is the option to enable LabVIEW to act as an ActiveX server. This much I know I need to do.
I thought I would open this discussion again as others may be interested and there doesn't appear to be a completely clear solution available. Please do contribute where you can.
Cheers,
Battler.
08-18-2009 05:19 AM
Hi, Battler,
Probably you can do this without ActiveX.
Read the following KB articles:
How Do I Associate Custom File Extensions with an Application Built in LabVIEW
How Can I Programmatically Associate a File Extension to My LabVIEW Built Application
Andrey.
08-18-2009 05:37 AM
That's fantastic. Maybe I should learn to use KB!
I'll have a read, give it a go and let you know if I have a solution.
Cheers,
Battler
08-18-2009 07:30 AM
Hi there,
My application is opening when I double-click on the custom file type. However, it comes up with dialog:
"C:......\file.abc is not a valid LabVIEW file."
Then it opens. I don't want that to happen. Any ideas?
Battler.
08-18-2009 07:42 AM
Nevermind. Sorted. Just had to enable"Pass all command line arguments".
Does anyone know if these actions also assign the applications custom icon to the file type? I cannot be sure because I had previously manually done this.
08-18-2009 07:55 AM
My application consists of Event Structure.
How to register for ommand line event so that when a user double-clicks on a .abc file I can handle the opening of it?
This needs to work (the files need to open) not only when the application is closed but also when it's already open.
Anyone have ideas?
08-18-2009 08:06 AM
battler. wrote:My application consists of Event Structure.
How to register for ommand line event so that when a user double-clicks on a .abc file I can handle the opening of it?
This needs to work (the files need to open) not only when the application is closed but also when it's already open.
Anyone have ideas?
Aha, thats not so easy, but impossible is nothing. One possible solution - two applications. One is "helper" application, which will receive your command line, and then send parameters to the second application (ans optionally start this application if not started yet). "Helper" should be terminated after that.
Andrey.
08-18-2009 03:07 PM
battler. wrote:My application consists of Event Structure.
How to register for ommand line event so that when a user double-clicks on a .abc file I can handle the opening of it?
This needs to work (the files need to open) not only when the application is closed but also when it's already open.
Anyone have ideas?
The solution to that is to implement a DDE server in your application (and add DDE entries to the registry on installation). There are still DDE functions in LabVIEW vi.lib\Platform\dde.llb but they are considered depreciated and have been removed from the palette, also because Microsoft is trying to tell everyone that DDE is depreciated and sort of unsupported too. But it is still the mechanisme to pass actions from the shell to running applications.
I hesitate to send you over to lavag.org where there have been some discussions about this years ago. If you go there you would do good to employ a friendly attitude. That board is run all by enthusiasts and idealists and they are all great folks but react not very friendly to people with an attitude.
Rolf Kalbermatter
08-18-2009 07:24 PM
Rolf, I would greatly appreciate it if you could help me to find the information.
Thanks,
Battler.
08-18-2009 07:25 PM