#2
ehszt2016-09-02 16:26
这是Unit2.cpp中全部代码
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit2.h" #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TChildFrm *ChildFrm; //--------------------------------------------------------------------------- __fastcall TChildFrm::TChildFrm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TChildFrm::New1Click(TObject *Sender) { MDIFrm->New1Click(Sender); } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Open1Click(TObject *Sender) { MDIFrm->Open1Click(Sender); } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Save1Click(TObject *Sender) { if(SaveDialog1->Execute()) { RichEdit1->Lines->SaveToFile(SaveDialog1->FileName+".txt"); } } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Copy1Click(TObject *Sender) { RichEdit1->CopyToClipboard(); //这个RichEdit1要如何定义? } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Cut1Click(TObject *Sender) { RichEdit1->CutToClipboard(); } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Paste1Click(TObject *Sender) { RichEdit1->PasteFromClipboard(); } //--------------------------------------------------------------------------- void __fastcall TChildFrm::Exit1Click(TObject *Sender) { MDIFrm->ActiveMDIChild->Close(); } //--------------------------------------------------------------------------- void __fastcall TChildFrm::FormCreate(TObject *Sender) { } //--------------------------------------------------------------------------- [此贴子已经被作者于2016-9-2 17:03编辑过] |
[C++ Error] Unit2.cpp(32): E2451 Undefined symbol 'RichEdit1'
[C++ Error] Unit2.cpp(38): E2451 Undefined symbol 'RichEdit1'
[C++ Error] Unit2.cpp(43): E2451 Undefined symbol 'RichEdit1'
[C++ Error] Unit2.cpp(48): E2451 Undefined symbol 'RichEdit1'
[此贴子已经被作者于2016-9-2 17:02编辑过]