C
can320
Gast
Das Programm spielt beim start 5 mal ne Sound Datei ab:
Nach dem der Sound einmal abgespielt wurde erscheint die Meldung:
Woran könnte es liegen? Habe bereits ein Thread.Sleep(5000) ausprobiert ... (5 Sek. reichen)
Code:
[System.Runtime.InteropServices.DllImport("WinMM.dll")]
public static extern long PlaySound(String lpszFileN[QUOTE][/QUOTE]ame, long hModule, long dwFlags);
private void Form1_Load(object sender, EventArgs e)
{
Thread Sound;
Sound = new Thread(new ThreadStart(SoundDatei));
Sound.Start();
}
public void SoundDatei()
{
for (int i = 0; i < 5; i++)
PlaySound(Application.StartupPath + "/test.wav", 0, 0);
}
Nach dem der Sound einmal abgespielt wurde erscheint die Meldung:
A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Form1:laySound' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Woran könnte es liegen? Habe bereits ein Thread.Sleep(5000) ausprobiert ... (5 Sek. reichen)