|
class TGrid : public TStringGrid
{
public:
TGrid()
{
}
};
이렇게 변경을 했어도 동일한 에러가 발생합니다.
Lyn 님이 쓰신 글 :
: 기본생성자를 선언만 하고 구현을 안했네요
:
: 이용태 님이 쓰신 글 :
: : TStringGrid를 상속받아 TGrid라는 클래스를 만들려고 하는데요
: :
: : class TGrid : public TStringGrid
: : {
: : public:
: : TGrid();
: : };
: :
: : 다음과 같은 에러가 납니다.
: : "Complier could not generate default constructor for class 'TGrid'"
: :
: : 왜 그런건가요?
: :
: :
: : //.h
: : //---------------------------------------------------------------------------
: :
: : #ifndef Unit1H
: : #define Unit1H
: : //---------------------------------------------------------------------------
: : #include <Classes.hpp>
: : #include <Controls.hpp>
: : #include <StdCtrls.hpp>
: : #include <Forms.hpp>
: : #include <ComCtrls.hpp>
: : #include <Grids.hpp>
: : //---------------------------------------------------------------------------
: :
: : class TGrid : public TStringGrid
: : {
: : public:
: : TGrid();
: : };
: :
: :
: :
: : class TForm1 : public TForm
: : {
: : __published: // IDE-managed Components
: : TStringGrid *StringGrid1;
: :
: : private: // User declarations
: : public: // User declarations
: : __fastcall TForm1(TComponent* Owner);
: :
: : TGrid *myGrid;
: : };
: : //---------------------------------------------------------------------------
: : extern PACKAGE TForm1 *Form1;
: : //---------------------------------------------------------------------------
: : #endif
: :
: :
: :
: :
: :
: :
: :
: : //.cpp
: : #include <vcl.h>
: : #pragma hdrstop
: :
: : #include "Unit1.h"
: : //---------------------------------------------------------------------------
: : #pragma package(smart_init)
: : #pragma link "ntabed"
: : #pragma link "replist"
: : #pragma resource "*.dfm"
: : TForm1 *Form1;
: : //---------------------------------------------------------------------------
: : __fastcall TForm1::TForm1(TComponent* Owner)
: : : TForm(Owner)
: : {
: : myGrid = new TGrid;
: : }
: : //---------------------------------------------------------------------------
|