Autor Beitrag
Mister X-Ray
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41

Win XP, Win 2000
D7 Pers, D2005 Pers
BeitragVerfasst: Mo 04.04.05 14:20 
Hallo,

wie kann ich sndPlaySound als ertes Argument (also der Dateiname) eine Variable übergeben? Bei mir funktioniert das nicht ....

also

ausblenden Delphi-Quelltext
1:
name: String;					

(Die Deklaration)

ausblenden Delphi-Quelltext
1:
2:
name := Edit1.Text;
sndPlaySound(name+'.wav', SND_ASYNC);


Was ist daran falsch?

Fehlermeldung:
Inkompatible Typen: 'String' und 'PAnsiChar'

Gruß
Mister X-Ray
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 04.04.05 15:45 
Hallo,

so:
ausblenden Delphi-Quelltext
1:
sndPlaySound(PChar(name+'.wav'), SND_ASYNC);					


Ps.: Schon mal hier im Forum nach "sndPlaySound" gesucht? >> 53 Ergebnisse :?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Mister X-Ray Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41

Win XP, Win 2000
D7 Pers, D2005 Pers
BeitragVerfasst: Mo 04.04.05 19:40 
wunderbar genau das wars ....

Danke
Mister X-Ray