SoloCodigo

Programación General => C/C++ => C++ Builder => Mensaje iniciado por: ruben14 en Miércoles 24 de Noviembre de 2010, 07:37

Título: Problema con PlaySound
Publicado por: ruben14 en Miércoles 24 de Noviembre de 2010, 07:37
Al poner

Citar
  PlaySound(ExtractFilePath(Application->ExeName)+"\Sound\tap.mp3"),NULL,SND_RESOURCE || SND_ASYNC)

me da el siguiente error:

Cannot Convert 'AnsiString'  to  'Const char *'

Alguna Idea

Gracias
Título: Re: Problema con PlaySound
Publicado por: softevolutions en Miércoles 24 de Noviembre de 2010, 16:31
PlaySound( (ExtractFilePath(Application->ExeName)+"\Sound\tap.mp3").c_str() ),NULL,SND_RESOURCE || SND_ASYNC)
Título: Re: Problema con PlaySound
Publicado por: ruben14 en Miércoles 24 de Noviembre de 2010, 20:07
Gracias por contestar...

Me sigue dando error ahora este:

Too Few parameter in call to '__stdcall PlaySound(const char*,void*,unsigned long)'

Gracias otra vez
Título: Re: Problema con PlaySound
Publicado por: softevolutions en Miércoles 24 de Noviembre de 2010, 20:12
Al responderte no me di cuenta de que te sobraba un paréntesis de cierre:

PlaySound( (ExtractFilePath(Application->ExeName)+"\Sound\tap.mp3").c_str() ),NULL,SND_RESOURCE || SND_ASYNC)

Sería así:

PlaySound( (ExtractFilePath(Application->ExeName)+"\Sound\tap.mp3").c_str(), NULL, SND_RESOURCE || SND_ASYNC)
Título: Re: Problema con PlaySound
Publicado por: ruben14 en Jueves 25 de Noviembre de 2010, 07:30
Perfecto...

Muchas Gracias