|
-
Nov 6th, 1999, 10:40 AM
#2
OK, there's a couple of things..
I suspect that your Path stored in the Label contains a Directory Name which has a Space in it, eg. "Program Files", in which case Shell would try to Run the Text upto Program and Treat Files.. Etc as a Command Line. Or, your path doesn't include a File Name.
2nd, Shell doesn't run Files by Association, this means when you pass it the File with an "rm" extension it will Error.
What you need to use is the ShellExecute API which will Open a File with its associated Application and also enclose the Path and File name in Quotes, eg.
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
ShellExecute 0, "OPEN", Chr(34) & lblMusic & Chr(34), "", "", 1
End Sub
Where lblMusic contains the Full Path and Name of the "rm" File, eg. C:\My Files\Music.rm"
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|