Double Click Me All The Way To Heaven
May 18, 2009 2:11 PM
Subscribe
Visual Basic 6 Filter: Double click on file, my program opens that file. How do I do it?
Quick Summary: I have a program that I have written in VB6. I would like to associate this program with a file extension. When I double click on a file with this extension (BRD) I want my program to automatically open with that file loaded.
I was able to make this work on the command line. If I type
"myexecutable.exe openthisfile.brd"
then my program opens that file. I used this code...
Private Sub Form_Load()
If ((Command <> "") And (FileExists(Command))) Then
OpenSoundBoard(Command)
End If
End Sub
I am not concerned with registering my program with Windows. I would like, however, to always open BRD files with my program. I have done this without using the registry by telling Windows to always use myprogram.exe to open BRD files. However, when I double click on a BRD file myprogram.exe throws an error:
Run-time Error '52':
Bad file name or number
I don't know the terminology for this problem, so searching for an answer has been unfruitful. I am no expert in VB, but I know enough to get myself into trouble - as I have done here. Any help would be appreciated. Thanks MeFites!>
posted by Brettus to computers & internet (6 comments total)
The easiest way to do that is to right-click the file and select "open with" plus appropriate choice from the resulting menu. You haven't said what OS you're using, so I'm assuming WinXP here: the menu choice is "Choose Program".
It'll pop up a menu permitting you to select an app; you use it to find yours. Then make sure that the "Always use this application" check mark is selected.
posted by Chocolate Pickle at 2:16 PM on May 18