全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1418
推到 Plurk!
推到 Facebook!

ic卡的讀寫動作

尚未結案
aamihcom
一般會員


發表:57
回覆:40
積分:19
註冊:2003-10-02

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-15 04:29:35 IP:61.59.xxx.xxx 未訂閱
請教各位先進我要做一個ic卡的讀寫動作,廠商有提供dll檔 我己經都設好了.不過以下這個function我有一些不清楚的地方請各位指導一下 (範例是vc的語法,我改到bcb有一些問題)    BOOL WINAPI icRemainTimes(LPDWORD dwRemainTimes);//?LPDWORD Function說明: 檢查尚有多少次的驗證密碼動作,每驗證失敗一次會自動減1。 參數說明: dwRemainTimes:        剩餘次數    回傳值:  成功回傳1, 失敗回傳0的值.    範例:         DWORD dwRemainTimes;  //DWORD 是什麼型態,在bcb要用什麼取代         if(icRemainTimes(&dwRemainTimes)==TRUE)         {         CString s1;   //此CString 是什麼型態,在bcb要用什麼取代         s1.Format("Password access remain %d times", dwRemainTimes);         AfxMessageBox(s1);         }
Zard
尊榮會員


發表:24
回覆:396
積分:539
註冊:2003-11-26

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-15 17:26:23 IP:61.64.xxx.xxx 未訂閱
引言: 請教各位先進我要做一個ic卡的讀寫動作,廠商有提供dll檔 我己經都設好了.不過以下這個function我有一些不清楚的地方請各位指導一下 (範例是vc的語法,我改到bcb有一些問題) BOOL WINAPI icRemainTimes(LPDWORD dwRemainTimes);//?LPDWORD Function說明: 檢查尚有多少次的驗證密碼動作,每驗證失敗一次會自動減1。 參數說明: dwRemainTimes: 剩餘次數 回傳值: 成功回傳1, 失敗回傳0的值. 範例: DWORD dwRemainTimes; //DWORD 是什麼型態,在bcb要用什麼取代 if(icRemainTimes(&dwRemainTimes)==TRUE) { CString s1; //此CString 是什麼型態,在bcb要用什麼取代 s1.Format("Password access remain %d times", dwRemainTimes); AfxMessageBox(s1); }
修改如下
DWORD dwRemainTimes;
if(icRemainTimes(&dwRemainTimes)==TRUE)
{
  AnsiString s1;
  s1 = Format("Password access remain %d times", ARRAYOFCONST((dwRemainTimes)) );
  ShowMessage(s1);
}
發表人 - zard 於 2005/01/15 17:29:26
aamihcom
一般會員


發表:57
回覆:40
積分:19
註冊:2003-10-02

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-16 22:48:12 IP:61.59.xxx.xxx 未訂閱
您好,謝謝你幫我處理不過,我改了之後出現以下錯誤訊息,我在想是不是 DWORD 的型態,不能用ARRAYOFCONST來轉換    [C++ Error] Unit1.cpp(42): E2285 Could not find a match for 'OpenArray::OpenArray(unsigned long)' [C Error] Unit1.cpp(42): E2031 Cannot cast from 'unsigned long' to 'OpenArray' [C Error] Unit1.cpp(42): E2285 Could not find a match for 'OpenArrayCount::OpenArrayCount(unsigned long)' [C Error] Unit1.cpp(42): E2031 Cannot cast from 'unsigned long' to 'OpenArrayCount'
Zard
尊榮會員


發表:24
回覆:396
積分:539
註冊:2003-11-26

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-01-17 09:07:20 IP:210.243.xxx.xxx 未訂閱
引言: 您好,謝謝你幫我處理不過,我改了之後出現以下錯誤訊息,我在想是不是 DWORD 的型態,不能用ARRAYOFCONST來轉換 [C Error] Unit1.cpp(42): E2285 Could not find a match for 'OpenArray::OpenArray(unsigned long)' [C Error] Unit1.cpp(42): E2031 Cannot cast from 'unsigned long' to 'OpenArray' [C Error] Unit1.cpp(42): E2285 Could not find a match for 'OpenArrayCount::OpenArrayCount(unsigned long)' [C Error] Unit1.cpp(42): E2031 Cannot cast from 'unsigned long' to 'OpenArrayCount'
請加入紅字處的碼
DWORD dwRemainTimes;
if(icRemainTimes(&dwRemainTimes)==TRUE)
{
  AnsiString s1;
  s1 = Format("Password access remain %d times", ARRAYOFCONST(((int)dwRemainTimes)) );
  ShowMessage(s1);
}    
aamihcom
一般會員


發表:57
回覆:40
積分:19
註冊:2003-10-02

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-01-17 16:30:49 IP:211.23.xxx.xxx 未訂閱
請問一下,這個"ARRAYOFCONST",是什麼意思,我不太了解~~ 指教一下. 謝謝
Zard
尊榮會員


發表:24
回覆:396
積分:539
註冊:2003-11-26

發送簡訊給我
#6 引用回覆 回覆 發表時間:2005-01-17 18:11:54 IP:210.243.xxx.xxx 未訂閱
引言: 請問一下,這個"ARRAYOFCONST",是什麼意思,我不太了解~~ 指教一下. 謝謝
Help裡就有了...... Assembles a set of values into a TVarRec array and the index of the last element. #define ARRAYOFCONST(values) OpenArray〈TVarRec〉values, OpenArrayCount〈TVarRec〉values.GetHigh() Description C Builder uses arrays of TVarRec to emulate the Object Pascal construct array of const. When calling VCL methods that take such an array as a parameter, you can use the ARRAYOFCONST macro, passing in a comma-delimited set of values, rather than constructing an array of TVarRec values and passing the index of the last element of the array.
aamihcom
一般會員


發表:57
回覆:40
積分:19
註冊:2003-10-02

發送簡訊給我
#7 引用回覆 回覆 發表時間:2005-01-17 20:45:04 IP:61.59.xxx.xxx 未訂閱
謝謝~~^^'
系統時間:2024-04-27 17:54:30
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!