Start application from vb5

I have been using the following code to open applications from vb5.  It works on most applications and in particular a version of music match written in VB.  Their latest version was written in C++ and it won't open with this code.  I can double click on a file.m3u and it will open.  How do I need to change the code to be able to open any application within vb5?

Private Sub List3_Click()
Dim musicfil As String
musicfil = List3.Text & ".m3u"
Dim lngRetVal As Long
ShellExecute Me.hwnd, "Open", musicfil, 0&, 0&, 5
End Sub
donb1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

twardCommented:
Does it give you an error?  Does it simply not run the program?

It looks like you are running a file that is associated with this executable but maybe the association is not there any longer..?
0
DrDelphiCommented:
It doesn't matter what the application that you are trying to launch was written in. So long as the association to that file type is made in Windows, ShellExecute will launch the appropriate EXE. If this has worked in the past and is not now, I would check that under File Types in Windows it actually specifies the application under OPEN.

0
donb1Author Commented:
The association is there, otherwise it would not open when I click on the file.m3u icon.  Question is, is my code correct?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

SLECommented:
Are you passing the FULL filename (with path)?
0
JuiletteCommented:
'open a file with it's associated application
'this example opens addin.txt with notepad
'put this in a bas module
'
Public Declare Function ShellEx Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As Any, _
ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
'
Sub ShellDef(strFileName)
x = ShellEx(Form1.hwnd, "open", strFileName, "", "", 1)
End Sub

'>>>>>>>>>>>>>>>>> code for event on form <<<<<<<<<<<<<<<<<<<<<<<<<<
'
      ShellDef ("c:\my documents\addin.txt")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
donb1Author Commented:
Thanks
That drag and drop is interesting but more complex than I need now.
0
caraf_gCommented:
The drag and drop is just a feature which can be taken out without a problem. What's important is how the code takes your file extension, looks up the registry to find out what the correct action is for this extension, and then executes it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.