看板 C_Sharp 關於我們 聯絡資訊
小弟第一次使用API,想用在PDA的程式裡 在網路上問到可以使用playsound 也查到MSDN的資料 http://0rz.tw/ab2BN 但是在 private const SND_FILENAME = 0x00020000 ; private const SND_SYNC = 0x0000 ; 這一段的部份在"="處出現必須是識別碼的問題 查C#的書也沒有看到這個解決方式 請問一下這要怎樣解決? 程式碼: public class sound { private const SND_FILENAME = 0x00020000 ; private const SND_SYNC = 0x0000 ; public sound() { PlaySound("C:\\pro\\Sounds\\Infbeg.wav", 0, 0); } [DllImport ("coredll")] public Function PlaySound(string szSound, IntPtr hMod, int flags ); } 用的系統是VS.2003,會是版本的問題嗎? 如果是用VS.2003可以怎樣解決? -- 小弟是學過C++,現在直接學用C# 所以在某些觀念不是很充足... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.58.241
saitoh:你沒有給變數資料型別.... 05/17 22:06
※ 編輯: sthouse 來自: 220.133.58.241 (05/17 22:23)
sthouse:加上uint就解決了... 05/17 22:25