| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
A N00B programmer wanting to play music using MCI
so i found this sample code online to play audio files at: the code project, by Jerod Edward Moemka.
i pretty much just copied it verbatim, and i feel i understand how it's supposed to work, but the only programming i've done has been with namespace std, and i'm not sure how the system namespace is supposed to work. it comes up with like 121 errors currently. i'm not sure if it's a preprocessor i'm missing or not, but this is all the code i have so far: #include "stdafx.h" #include <string> #include <iostream> #include <Windows.h> #include <fstream> #include "Mmsystem.h" using System; using System.Runtime.InteropServices; [DllImport("winmm.dll")] extern static int mciSendString(string command, IntPtr responseBuffer,int bufferLength, int nothing); void main() { while(true) { Console.WriteLine("Type in the fully qualified" + " path to the file you want to play"); string file = Console.ReadLine(); if(file != "end") { string command = string.Format("play {0}",file); IntPtr response = Marshal.AllocHGlobal(128); int err = mciSendString(command,response,128,0); Console.WriteLine("{0} error(s)",err); }else break; } } any help you guys can give would be a tremendous help. |
![]() |
| Viewing: Tutorialized Forums > Desktop Programming > C and Cpp > A N00B programmer wanting to play music using MCI |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|