mailto hyperlink & embed wav file in exe program?

I don't know if this question is easy or hard or whatever so I'll start with 50 pts.

I'm taking an intro VB6 course.  

I know how to play a wav file, but I would like to embed the wav file in the finished exe file.

When I run the following code the wave file in the same folder as the saved project file plays correctly, but....(see problem after code)

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub PlaySnd()
   Dim tmp%
   'tmp% = sndPlaySound("D:\My Documents\FUNNIES\dotcom.wav", 1)
   tmp% = sndPlaySound(App.Path & "\dotcom.wav", 1)
End Sub

Private Sub Command1_Click()
Call PlaySnd
End Sub


Problem:

When I choose "make project1 exe" and save it to another dir, the wav doesn't play.  How do I fix this?

Also, I know how to launch the default browser from a lbl.caption, but how do I code a "mailto:" hyperlink similarly?
greg1Asked:
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.

greg1Author Commented:
Edited text of question.
0
JuiletteCommented:

'launch default email program and send mail

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 Const SW_SHOW = 5
   
'form code
ShellExecute hwnd, "open", "mailto:vbcode@vbcode.com", vbNullString, vbNullString, SW_SHOW


'check your app path statements

Dim AppPath$
           
        If Right(App.Path, 1) <> "\" Then _
        AppPath = App.Path & "\" _
        Else AppPath = App.Path
       
        End If
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
greg1Author Commented:
Thanks for the prompt response Julliette, the mail code is great, but maybe I wasn't clear on explaining my wav problem.

The wav file plays correctly before or after making the project exe, but only if the wav file is in the same dir as the exe file.  

I need to embed the wav file in the exe file, so a separate wav file is not needed.

Here's what I've got:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub PlaySnd()
   Dim tmp%
   Dim AppPath$
   If Right(App.Path, 1) <> "\" Then
      AppPath = App.Path & "\"
      Else: AppPath = App.Path
   End If
   'tmp% = sndPlaySound("D:\My Documents\FUNNIES\dotcom.wav", 1)
   tmp% = sndPlaySound(App.Path & "\dotcom.wav", 1)
End Sub

Private Sub Command1_Click()
Call PlaySnd
End Sub

Please make any necessary corrections, thank you for your patience.

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!

JuiletteCommented:
That one is over my heae, I haven't a clue om embedding because I  was led to believe that if you make an exe then everything it needed should be included in the exe.

Sorry, you can reject my answer.

Ps..not meaning to be rude on anything, but it might be helpful to yourself and people who answer if a question was a question. One Question One Answer.

Good luck,
Wayne
0
KDivadCommented:
I think .wav files can be added into resource files, but I don't know how...
0
Erick37Commented:
Yes, wave files can be added as custom (byte) resource data.  You can use any resource compiler, or the Resource Editor Add-In which comes with VB.

More info from MS:

http://support.microsoft.com/support/kb/articles/Q141/5/05.asp
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.