Note: this is for C++
http://www.world-voices.com/resources/cpp.html
an example:
Code:
#include <iostream.h>
#include <CString.h>
#include <windows.h>
#include <conio.h>
#pragma comment( lib, "winmm.lib" ) // Search For WinMM Library While Linking
bool opened=false;
void playM(CString);
void closeM();
int main()
{
CString buf;
CString buf2;
int init;
cout<<"Enter path of midi file: ";
getline(cin,buf);
buf2 = "Do you want to play: "+buf;
init=MessageBox(NULL,buf2.std_str(),"PlayMusic",MB_YESNO|MB_ICONQUESTION);
if(init==IDYES)
{
playM(buf);
MessageBox(NULL,"Press OK to stop Playing Music","Title goes here dork!",MB_OK);
buf2="play "+buf;
mciSendString(buf2.std_str(),NULL,0,NULL);
MessageBox(NULL,"Press OK to stop Playing Music","Title goes here dork!",MB_OK);
closeM();
}
return 0;
}
void playM(CString buf)
{
CString buf2;
buf.makeDirectoryPath();
buf2= "play "+buf;
buf = "open "+buf+" type sequencer";
mciSendString(buf.std_str(),NULL,0,NULL);
mciSendString(buf2.std_str(),NULL,0,NULL);
}
void closeM()
{
mciSendString("close all",NULL,0,NULL);
}
a program I wrote a while ago...
if u want CString....
CString.zip
-LC