진짜준비는 그게아니였어
두글자이상
비는부분채우기
7개정도로만들기
긍정부정표현적기
//import
[DllImport("winmm.dll")]
public static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume);
[DllImport("winmm.dll")]
public static extern int waveOutSetVolume(IntPtr hwo, uint dwVolume);
//initialize
uint CurrVol = 0;
// At this point, CurrVol gets assigned the volume
waveOutGetVolume(IntPtr.Zero, out CurrVol);
// Calculate the volume
ushort CalcVol = (ushort)(CurrVol & 0x0000ffff);
// Get the volume on a scale of 1 to 10 (to fit the trackbar)
volume = CalcVol / (ushort.MaxValue / 10);
#region volumeUp
// Calculate the volume that's being set
int NewVolume = ((ushort.MaxValue / 10) * (++volume));
// Set the same volume for both the left and the right channels
uint NewVolumeAllChannels = (((uint)NewVolume & 0x0000ffff) | ((uint)NewVolume << 16));
// Set the volume
waveOutSetVolume(IntPtr.Zero, NewVolumeAllChannels);
#endregion
상황은 다음과 같습니다.
1. unmanaged LIB 가 있습니다.
2. unmanaged LIB를 이용해 managed dll 을 만들었습니다.
3. 이때 managed dll 에서 unmanaged 쪽 특정 struCt 를 인스턴스 합니다.
4. C#에서 폼을 로드 할 때, 크래쉬가 납니다.
문 제는 특정 struCt 만 인스턴스 할 때 크래쉬가 난다는 점 입니다.
다른 클래스, 다른 struCt를 인스턴스 할 때는 매우 잘 되는데, 특정 struCt만 인스턴스 하면 발생 합니다.
에 러 메세지는 다음과 같이 발생 합니다.
An unhandled exCeption of type 'System.IO.FileNotFoundExCeption' oCCurred in test.exe
Additional information: 지정된 모듈을 찾을 수 없습니다. (예외가 발생한 HRESULT: 0x8007007E)
혹시 이런 문제를 아시나요?
[답변]자답 - 해당 struct 의 정의 부분을 cpp로 따로 빼면, 잘 됩니다. 2010-05-12 오전 11:04:00
최익필 (ikpil) 번호: 826404 추천:0
자답
1. 해당 struct 의 정의 부분을 cpp로 따로 빼면, 잘 됩니다.
해본 것들
1. 이름을 바꾸어 봄 = 안됨
2. 이름만 다른 동일한 struct를 만들어 봄 = 이름이 다른 동일한 struct는 잘 되나, 결국 해야할 struct는 안됨
3. 동일한 이름을 만들어봄 = 컴파일 자체가 안됨
4. 해당 struct의 정의 부분을 cpp로 따로 뺌 - 잘 됨