Does any1 know how to generate sound?

I have been trying to play around with the low level API's to do with sound but so far i have got nowwhere. I can't seem to get past the WaveOutOpen. It returns some message saying that an invalid parameter was passed.

who knows?

MY CODE ->

Result = waveOutOpen(WO_Handle, WAVE_MAPPER, WO_Format, WAVoutCALLBACK, True, WAVE_MAPPED Or CALLBACK_FUNCTION)