just trying to understand

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • steve marchant

    #1

    just trying to understand

    You can see I'm quite new to this. VB5. Trying to play a sound using
    embedding. So I put an OLE control in the form and created an object from
    file. Here's the code hoping to produce an exe for use in another pc:

    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA " (ByVal
    lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    ' ............... ............... ............... ...............

    Private Sub Command1_Click( )

    PlaySound "c:\windows\med ia\microsoft office 2000\gunshot.wa v", 0, 0

    End Sub

    When I run the exe on the other pc (which doesn't have the file), silence -
    just
    a message saying "unable to access source document".
    Then I added another line:

    Private Sub Command1_Click( )
    OLE1.CreateEmbe d "c:\windows\med ia\microsoft office 2000\gunshot.wa v"

    PlaySound "c:\windows\med ia\microsoft office 2000\gunshot.wa v", 0, 0

    End Sub

    Still nothing. I'm doing my nut over this. Where am I going wrong? Any help
    appreciated. BTW both versions work on a pc containing the required wav
    file.
    steve










Working...