Matthew Webster
Member
Can anyone tell me why this code:
using System;
using System.Runtime.InteropServices;
namespace VolumeTest
{
public class VolumeControl
{
[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutSetVolume(int uDeviceID, int dwVolume);
[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutGetVolume(int uDeviceID);
public static void Main(string[] args)
{
waveOutSetVolume( 0, 0xFFFF );
Console.WriteLine( waveOutGetVolume( 0 ) );
}
}
}
Throws the following error:
The instruction at "0x7c9118d0" referenced memory "0x00005c00". The memory could not be "written".
Please?
I am trying to get the initial system volume and be able to control it.
Matt.
using System;
using System.Runtime.InteropServices;
namespace VolumeTest
{
public class VolumeControl
{
[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutSetVolume(int uDeviceID, int dwVolume);
[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutGetVolume(int uDeviceID);
public static void Main(string[] args)
{
waveOutSetVolume( 0, 0xFFFF );
Console.WriteLine( waveOutGetVolume( 0 ) );
}
}
}
Throws the following error:
The instruction at "0x7c9118d0" referenced memory "0x00005c00". The memory could not be "written".
Please?
I am trying to get the initial system volume and be able to control it.
Matt.