我照書打範例或拿書上範例都不能執行 |
尚未結案
|
kenya168
一般會員 發表:3 回覆:10 積分:2 註冊:2007-04-23 發送簡訊給我 |
我是在書局買了 "多媒體視訊程式設計-使用Delphi" 這本書,
但是不論是從第五章開使照書上的範例打, 或是直接把光碟中的範例程式拿來執行, 都出現很多很多的Error, 如以下: 在照書上說 : 從IDE Menu選取[Project | Add TO Project 、、、],將VFW.PAS加入到專案中。或者是一開使就說要把VFW SDK的資料夾加到Environment Options裡, 這些動作都有照著書上做完成, 但每次在要執行時都在VFW.PAS裡出現ERROR, 出現在以下這一行: //影像擷取之資訊區塊 資料結構 PCapInfoChunk = ^TCapInfoChunk; TCapInfoChunk = record fccInfoID :FOURCC; // 四個字元的資訊辨識碼 lpData :Pointer; // 資料指標 cbData :LongInt; // 資料大小 底下的ERROR訊息如以下: [Error] VFW.pas(246): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(253): E2003 Undeclared identifier: 'pByte' [Error] VFW.pas(277): E2003 Undeclared identifier: 'PWAVEHDR' [Error] VFW.pas(321): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(323): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(325): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(328): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(330): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(334): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(336): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(338): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(345): E2003 Undeclared identifier: 'PWaveFormatEx' [Error] VFW.pas(363): E2003 Undeclared identifier: 'pBitmapInfo' [Error] VFW.pas(379): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(381): E2003 Undeclared identifier: 'pPoint' [Error] VFW.pas(407): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(409): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(411): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(413): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(417): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(419): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(439): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(446): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(568): E2003 Undeclared identifier: 'PBITMAPINFOHEADER' [Error] VFW.pas(580): E2003 Undeclared identifier: 'PPALETTEENTRY' [Error] VFW.pas(623): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(647): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(828): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(829): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(875): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(878): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(880): E2003 Undeclared identifier: 'PDWORD' [Error] VFW.pas(890): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(963): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(965): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(978): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(980): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1049): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1050): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1079): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1082): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1115): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1116): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1126): E2003 Undeclared identifier: 'PRECT' [Error] VFW.pas(1146): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1180): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1229): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1248): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1267): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1310): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1373): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1381): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1402): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1403): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1409): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1428): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1440): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1441): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1447): E2003 Undeclared identifier: 'PBOOL' [Error] VFW.pas(1449): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1451): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure [Error] VFW.pas(1856): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1858): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON} [Error] VFW.pas(1882): E2003 Undeclared identifier: 'IUnknown' [Error] VFW.pas(1937): E2003 Undeclared identifier: 'D1' [Error] VFW.pas(1937): E2003 Undeclared identifier: 'D2' [Error] VFW.pas(1937): E2003 Undeclared identifier: 'D4' [Error] VFW.pas(1938): E2003 Undeclared identifier: 'D1' [Error] VFW.pas(1938): E2003 Undeclared identifier: 'D2' [Error] VFW.pas(1938): E2003 Undeclared identifier: 'D4' [Error] VFW.pas(1939): E2003 Undeclared identifier: 'D1' [Error] VFW.pas(1939): E2003 Undeclared identifier: 'D2' [Error] VFW.pas(1939): E2003 Undeclared identifier: 'D4' [Error] VFW.pas(1940): E2003 Undeclared identifier: 'D1' [Error] VFW.pas(1940): E2003 Undeclared identifier: 'D2' [Error] VFW.pas(1940): E2003 Undeclared identifier: 'D4' [Error] VFW.pas(1941): E2003 Undeclared identifier: 'D1' [Error] VFW.pas(1941): E2003 Undeclared identifier: 'D2' [Error] VFW.pas(1941): E2003 Undeclared identifier: 'D4' [Fatal Error] VFW.pas(1943): E2226 Compilation terminated; too many errors 這個問題困擾我好久了, 因為我是初學者,不知道一開始是不是該設定些什麼東西, 才會讓這個問題一直卡住, 拜託拜託,麻煩請問有沒有人能幫幫我, 麻煩各位大大幫小小我指點一下, 也想請問一下 [ lpData :Pointer; // 資料指標] 這個是在做什麼用的呢? 小小我的信箱是: wenbobkimo@yahoo.com.tw 謝謝! 編輯記錄
taishyang 重新編輯於 2007-04-23 09:57:56, 註解 無‧
|
pcboy
版主 發表:177 回覆:1838 積分:1463 註冊:2004-01-13 發送簡訊給我 |
不是每個人都有哪本書, 建議您把該範例 和 VFW.pas 壓縮上傳讓大家看 一般公開的討論區, 希望知識公開交流 (除非真是不方便公開的資訊) 所以不會特別回信到您信箱, 請自己回來看 >lpData :Pointer; // 資料指標] 這個是在做什麼用的呢? 把 lpData 宣告成為指標
------
能力不足,求助於人;有能力時,幫幫別人;如果您滿意答覆,請適時結案! 子曰:問有三種,不懂則問,雖懂有疑則問,雖懂而想知更多則問!
編輯記錄
pcboy 重新編輯於 2007-04-23 08:40:55, 註解 無‧
|
kenya168
一般會員 發表:3 回覆:10 積分:2 註冊:2007-04-23 發送簡訊給我 |
|
pcboy
版主 發表:177 回覆:1838 積分:1463 註冊:2004-01-13 發送簡訊給我 |
對討論區功能不熟沒關係, 每個人都會經歷
kenya168 兄好像被打敗的太快 寫程式的人本來就會碰到很多不同的, 奇怪的情況 找來的範例不能用, 軟體本身的BUG, 在某些機器上無法正常跑, ... 寫程式不一定要用 Delphi, 但是有人使用和擁護, 必定也有他的原因 任何學習必然耗費時間, 很多人的程度都是千錘百鍊磨出來的 加油 ~
------
能力不足,求助於人;有能力時,幫幫別人;如果您滿意答覆,請適時結案! 子曰:問有三種,不懂則問,雖懂有疑則問,雖懂而想知更多則問! |
system72
中階會員 發表:15 回覆:114 積分:55 註冊:2005-08-17 發送簡訊給我 |
這種情況,通常是 你使用的Delphi 版本,跟書範例程式碼使用的Delphi版本不一樣 造成的.
因為原廠出廠時,有些底層的預設值會有所變動. 所以建議你,找書範例所使用的 Delphi 版本來試. 另外也在這,強烈建議 CodeGear ,能提供Delphi 30-60天試用版,免費給書的作者隨書附贈. 甚至,也許可以考慮哪拿 Delphi 2,3,4 等早期版免費隨書附贈, 但僅限學習使用,開發商業應用軟體須另買版權. 在 民國 86 或87 年時,本人就曾在書店看到一本書有隨書附贈 v c 1.0 完整版, 因而買了這本書. 而當時v c 好像已經出到 4.0 或 5.0 了. |
新手上路1234
一般會員 發表:3 回覆:24 積分:15 註冊:2002-12-27 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |