CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    100

    music in visual c++ !!!

    How to insert music into the project .... wave , mp3 midi files...
    to run with the program???

  2. #2
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: music in visual c++ !!!

    Quote Originally Posted by Ninja
    How to insert music into the project .... wave , mp3 midi files...
    to run with the program???
    You can include any file type in the executable in form of a custom resource.

  3. #3
    Join Date
    Aug 2004
    Location
    Bucharest, Romania... sometimes
    Posts
    1,039

    Re: music in visual c++ !!!

    Please find the attached zip archive for which you'll have to change the extension back to *.zip (I had to change the file's extension to frm because the upload procedure limits the file size of a zip to 100 kb, but a frm file can have more).
    I have downloaded this source code a long time ago (don't remember from where) and didn't test it myself. I hope it will work and be useful for you. If you have questions about it, there's an email address in the source code header: Tobias Bading ([email protected])
    Please let me know if you managed to get it working,
    Thanks,
    Attached Files Attached Files
    Bogdan Apostol
    ESRI Developer Network

    Compilers demystified - Function pointers in Visual Basic 6.0
    Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.

    Customize your R2H
    The unofficial board dedicated to ASUS R2H UMPC owners.

  4. #4
    Join Date
    Sep 2004
    Posts
    100

    Re: music in visual c++ !!!

    k thanks....

  5. #5
    Join Date
    Mar 2004
    Location
    Bangalore,karnataka,India
    Posts
    13

    Arrow Re: music in visual c++ !!!

    include following file:

    Code:
    #include "mmsystem.h"
    then add following code:

    Code:
    ::PlaySound("Chimes.wav",NULL,SND_FILENAME|SND_ASYNC);
    Go to Project->Settings->
    select tab links,
    in 'Object/Library Modules', add following file:

    winmm.lib

    run the application. if it dont work or any problem comes, i'll send example project, contact me.

  6. #6
    Join Date
    Jul 2004
    Posts
    243

    Re: music in visual c++ !!!

    For a bit more control than PlaySound take a look at mciSendString(), plenty of examples knocking about if you go to google.....

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