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

Thread: Out of context

  1. #1
    Join Date
    Sep 2000
    Posts
    127

    Out of context

    Below is my code to play .wav file
    f = mciSendString("open " & sWAV & " type waveaudio alias voice1", 0&, 0, 0)
    f = mciSendString("play voice1", 0&, 0, 0)

    I dont know why the VB complier says that the line' f = mciSendString("play voice1", 0&, 0, 0)' is out of context. What is meant by this & can it be solved?




  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Out of context

    Do you have both line in same sub? Out of context is a classical message that appear when your variables/objects are out of scope: say, you declared/loaded an obiect in a private sub, then tried to use it in another private sub; otr you declared it private in a module, and tried to use it somewhere else...


    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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