C# Can';找不到PInvoke DLL错误
我尝试使用进度条在MC3190Z中引用Locate标记,并希望显示进度条值随声音的变化。现在只使用摩托罗拉示例代码来播放声音。但声音只有一声嘟嘟C# Can';找不到PInvoke DLL错误,c#,windows-ce,rfid,C#,Windows Ce,Rfid,我尝试使用进度条在MC3190Z中引用Locate标记,并希望显示进度条值随声音的变化。现在只使用摩托罗拉示例代码来播放声音。但声音只有一声嘟嘟 m_LocateForm.Locate_PB.Value = tagDataArray[nIndex].LocationInfo.RelativeDistance; m_LocateForm.lastLocatedTagTimeStamp = System.Environment.TickCount; if (m_LocateForm.Loca
m_LocateForm.Locate_PB.Value = tagDataArray[nIndex].LocationInfo.RelativeDistance;
m_LocateForm.lastLocatedTagTimeStamp = System.Environment.TickCount;
if (m_LocateForm.Locate_PB.Value >0)
{ if (m_isBeepingEnabled) MessageBeep(MB_OK); }
想让它看起来好像标签更近了,所以进度条值很高,声音应该像快速的哔哔声。所以,当标签距离较远时,进度条较低,声音只是缓慢的嘟嘟声
我是否需要放置两种类型的声音来显示声音的变化
目前我的代码是
[DllImport("coredll.dll")]
internal static extern bool Beep(uint dwFreq, uint dwDuration);
if (m_isBeepingEnabled)
Beep(Convert.ToUInt32(m_LocateForm.Locate_PB.Value), 150);
但它显示错误无法找到PInvoke DLL,您可能需要尝试
使用以下标志定义
public enum PlaySoundFlags : uint {
SND_SYNC = 0x0, // play synchronously (default)
SND_ASYNC = 0x1, // play asynchronously
SND_NODEFAULT = 0x2, // silence (!default) if sound not found
SND_MEMORY = 0x4, // pszSound points to a memory file
SND_LOOP = 0x8, // loop the sound until next sndPlaySound
SND_NOSTOP = 0x10, // don't stop any currently playing sound
SND_NOWAIT = 0x2000, // don't wait if the driver is busy
SND_ALIAS = 0x10000, // name is a registry alias
SND_ALIAS_ID = 0x110000, // alias is a predefined ID
SND_FILENAME = 0x20000, // name is file name
SND_RESOURCE = 0x40004, // name is resource name or atom
};
public enum PlaySoundFlags : uint {
SND_SYNC = 0x0, // play synchronously (default)
SND_ASYNC = 0x1, // play asynchronously
SND_NODEFAULT = 0x2, // silence (!default) if sound not found
SND_MEMORY = 0x4, // pszSound points to a memory file
SND_LOOP = 0x8, // loop the sound until next sndPlaySound
SND_NOSTOP = 0x10, // don't stop any currently playing sound
SND_NOWAIT = 0x2000, // don't wait if the driver is busy
SND_ALIAS = 0x10000, // name is a registry alias
SND_ALIAS_ID = 0x110000, // alias is a predefined ID
SND_FILENAME = 0x20000, // name is file name
SND_RESOURCE = 0x40004, // name is resource name or atom
};