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

在BCB中的MDI環境有問題!!

尚未結案
jlvjlv
一般會員


發表:10
回覆:7
積分:3
註冊:2004-12-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-02-02 20:07:35 IP:220.228.xxx.xxx 未訂閱
各位厲害的大大~~    我現在才開始學使用BCB~~我現在在MDI應用程式中做出了個簡單的可開多張影像的程式~~不知道是BCB中原本就有限制還是怎樣~~我一直無法允許[Save].[Close]這些指令執行~~ void __fastcall TMainForm::UpdateActions() {    FileCloseItem->Enabled = MDIChildCount > 0;    FileSaveItem-> Enabled = MDIChildCount > 0; } 書上教我打上這程式~~    但無法執行~~[C++ Error] main.cpp(83): E2316 '_fastcall TMainForm::UpdateActions()' is not a member of 'TMainForm' 這是他的問題~~    我一直不知道問題出在哪~~麻煩各位厲害的大大~~幫幫我吧!! ********************************************************* 以下我附上全部ㄉ程式
//--------------------------------------------------------------------------
#include 
#pragma hdrstop    #include "Main.h"
#include "About.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------    __fastcall TMainForm::TMainForm(TComponent *Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::CreateMDIChild(String Name)
{
        TMDIChild *Child;            //--- create a new MDI child window ----
        Child = new TMDIChild(Application);
        Child->Caption = Name;
        Child->Image1->AutoSize=true;
              if (FileExists (Name))
                Child->Image1->Picture->LoadFromFile(Name);
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::FileNew1Execute(TObject *Sender)
{
        CreateMDIChild("NONAME"   IntToStr(MDIChildCount   1));
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::FileOpen1Execute(TObject *Sender)
{
        if (OpenPictureDialog1->Execute())
                CreateMDIChild(OpenPictureDialog1->FileName);
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::HelpAbout1Execute(TObject *Sender)
{
        AboutBox->ShowModal();
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::FileExit1Execute(TObject *Sender)
{
        Close();
}
//---------------------------------------------------------------------------        void __fastcall TMainForm::FileSaveItemClick(TObject *Sender)
{
      TMDIChild* TheChild;
      TPicture* ThePicture;          if (ActiveMDIChild)
      {
      TheChild=(TMDIChild*)ActiveMDIChild;
      ThePicture=TheChild->Image1->Picture;
      ThePicture->SaveToFile(TheChild->Caption);
      }
}
//---------------------------------------------------------------------------    void __fastcall TMainForm::UpdateActions()
{
   FileCloseItem->Enabled = MDIChildCount > 0;
   FileSaveItem-> Enabled = MDIChildCount > 0;
}    
RedSnow
版主


發表:79
回覆:1322
積分:845
註冊:2003-12-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-02-02 21:59:08 IP:219.136.xxx.xxx 未訂閱
jlvjlv 您好:    我不太清楚您的使用 BCB 版本,因此我以自身的環境 (BCB4) 來做相關說明如下:    雖然 TcustomForm 包裝有一個名為 UpdateActions 的函數,但是您應該是不可能直接使用該函數的,因此僅能推論您這個 UpdateActions 函數是屬於 "自定函數",而且可能是供 ActionList 的 OnUpdate 事件使用的,如果是這樣子的話,您應該查看一下相對於您這個 .cpp 檔的 .h 檔案 (應該是 Main.h 吧~) 內是否有 UpdateActions 函數的宣告?如果沒有宣告的話,就將它補上去,否則編譯器是不認識它的。    Main.h 檔案: void __fastcall UpdateActions();
jlvjlv
一般會員


發表:10
回覆:7
積分:3
註冊:2004-12-25

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-02-06 12:36:43 IP:61.230.xxx.xxx 未訂閱
不好意思~~這麼晚才有回應~~我不太會用這討論區~~RedSnow大大~~你ㄉ方式我正在試ㄌ~~但是還沒有什麼結果~~不過沒關西~~如果還有問題~~我會再提出ㄉ~~!! 謝謝ㄟ~~RedSnow大大!!!
系統時間:2024-05-19 18:33:21
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!