LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign file extension and custom icon to executable?

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.

 

 

 

 

0 Kudos
Message 1 of 39
(5,340 Views)

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

0 Kudos
Message 3 of 39
(5,319 Views)

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.

0 Kudos
Message 4 of 39
(5,289 Views)

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.

0 Kudos
Message 5 of 39
(5,280 Views)

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? 

0 Kudos
Message 6 of 39
(5,265 Views)

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.

 

0 Kudos
Message 7 of 39
(5,257 Views)

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

Rolf Kalbermatter
My Blog
Message 8 of 39
(5,210 Views)

Rolf, I would greatly appreciate it if you could help me to find the information.

 

Thanks,

 

Battler.

0 Kudos
Message 9 of 39
(5,197 Views)
Sorry I meant lavag.org.
0 Kudos
Message 10 of 39
(5,196 Views)