Windows CE 6.0 R3 で WaveOut API を P/Invoke する方法は?
これを入れると
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutOpen(ref IntPtr hWaveOut, int uDeviceID, ref WAVEFORMATEX lpFormat, DelegateWaveOutProc dwCallBack, int dwInstance, int dwFlags);
[DllImport("winmm.dll")]
public static extern MMRESULT waveInOpen(ref IntPtr hWaveIn, int deviceId, ref WAVEFORMATEX wfx, DelegateWaveInProc dwCallBack, int dwInstance, int dwFlags);
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT waveInStart(IntPtr hWaveIn);
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveInGetDevCaps(int index, ref WAVEINCAPS pwic, int cbwic);
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveInGetNumDevs();
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetDevCaps(int index, ref WAVEOUTCAPS pwoc, int cbwoc);
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveOutGetNumDevs();
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutWrite(IntPtr hWaveOut, ref WAVEHDR pwh, int cbwh);
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutPrepareHeader(IntPtr hWaveOut, ref WAVEHDR lpWaveOutHdr, int uSize);
Windows XP、7 では動作しますが、Wnidows CE 6.0 では「Can't P/Invoke winmm.dll」というメッセージがスローされます。
私は何を間違っていますか?WaveOut API は他の dll に移動されましたか、それとも別のものですか?
とにかく、SoundPlayer (.NET Compact Framework 3.5 から) は正しく動作します。