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

_popen無法正確執行

答題得分者是:taishyang
fusung
中階會員


發表:26
回覆:169
積分:99
註冊:2003-11-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2012-10-01 15:58:41 IP:42.70.xxx.xxx 訂閱
最近在測試_poepn指令於BCB6 & win7(winXP) 環境下, 無法正確取得FILE Handle, 

都是得到NULL, 想請問哪個環節我忽略了?

[code cpp]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char psBuffer[128];
FILE *chkdsk;
if( (chkdsk = _popen( "dir *.*", "r" )) == NULL )
ShowMessage("_popen failed");

}
[/code]


------


The first step toward proving things for yourself is to understand how others have done it before!

編輯記錄
fusung 重新編輯於 2012-10-01 01:59:55, 註解 無‧
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2012-10-03 16:16:18 IP:114.32.xxx.xxx 訂閱
這function是不是只能在console模式下使用壓^^?
fusung
中階會員


發表:26
回覆:169
積分:99
註冊:2003-11-25

發送簡訊給我
#3 引用回覆 回覆 發表時間:2012-10-03 16:31:28 IP:42.70.xxx.xxx 訂閱
感謝taishyang提醒, 果然用console專案就可以執行, 謝謝

另外附帶一提, 我本來是想在BCB6環境下呼叫gnuplot C API繪圖,

看來現在得透過額外呼叫console程式來繪圖了!

------


The first step toward proving things for yourself is to understand how others have done it before!

系統時間:2024-04-20 1:11:41
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!