Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/08/2011, 15:44
runegame
 
Fecha de Ingreso: junio-2011
Mensajes: 16
Antigüedad: 12 años, 10 meses
Puntos: 3
Exclamación Error en este programa

Buenas. Tengo un problema! este programa es un reproductor de musica, pero no funciona del todo, me reprodujo la musica una sola vez pero lo volvi a probar y no funciono! como hago? hay una forma de arreglar este problema? gracias!

Código C:
Ver original
  1. #include <windows.h>
  2. #include <stdio.h>
  3. #include <shlwapi.h>
  4. #include <Mmsystem.h>
  5. int main()
  6. {
  7.     SetConsoleTitle("Reproductor V1");
  8.     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN|FOREGROUND_INTENSITY);
  9.     char path[MAX_PATH];
  10.     int eleccion;
  11.     printf("1.Reproducir sonido\n");
  12.     printf("2.Salir\n\n>>");
  13.     scanf("%d",&eleccion);
  14. switch(eleccion){
  15.     case 1:
  16.     printf("\n\n\t\tSeleccione un archivo a reproducir\n\n>>");
  17.     scanf("%s",&path);
  18.         if(!PathFileExists(path)) return -1;
  19.         char command[260];
  20.         lstrcatA(command,"play ");
  21.         lstrcatA(command,path);
  22.         mciSendStringA(command,0,0,0);
  23.         printf("\n\n\nReproduciendo sonido\n");
  24.         system("pause > nul");
  25.         break;
  26.     case 2:
  27.         exit(1);
  28.         break;
  29.     default:
  30.     return -1;
  31.  
  32. }
  33. }

Ahi tienen el codigo. Gracias!