C and Cpp

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDesktop ProgrammingC and Cpp

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 2nd, 2008, 04:10 PM
nem5009 nem5009 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 nem5009 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 44 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingC and Cpp > A N00B programmer wanting to play music using MCI


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap