CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to Use micSendString?

    I use this :
    dim R as integer
    R=micSendString("OPEN c:\abc.mid TYPE sequencer alias abc", 0&, 0, 0) or
    R=micSendString("OPEN c:\abc.wav TYPE waveaudio alias abc", 0&, 0, 0) then right,but I use like this then wrong:
    dim strCmd as string
    strcmd="OPEN " & filename & " TYPE " & micType * " alias abc "
    R=micSendString(strCmd, 0&, 0, 0 ) is no mid or Cd or Wav Play,why?




  2. #2
    Guest

    Re: How to Use micSendString?

    let's put this in a class module and you'll get something like this:
    public lReturn as long
    Public sub mmOpen(byval TheFile as string)
    dim sType as string, sAlias as String
    'determine which type it is
    Select Case Ucase$(Right$(TheFile,3))
    Case "WAV"
    sType= "Waveaudio"
    Case "MID"
    sType = "AviVideo"
    ...
    End Select
    sAlias = Right(TheFile,3) & Minute(now) 'create unique alias

    lReturn = mciSendString("OPEN" & TheFile & " ALIAS " & sAlias _
    & " TYPE" & sType & " wait", "",0,0)
    End Sub

    Public Sub mmPlay()
    if sAlias = "" then exit sub
    nReturn= mciSendstring("PLAY " & sAlias,"",0,0)
    End Sub




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured