|
Unit1.h 를 다음과 같이.
두개의 클래스 교차 참조 문제입니다.
한쪽은 전체 프로토타입을 담지 말고,
class TForm2;
과 같이 다만 그것이 클래스라는 것을 명시해주면 됩니다.
그러면 컴파일러가 알아서 인식합니다.
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//#include "Unit2.h" 이것 대신
class TForm2; // 이걸로.
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TListBox *ListBox1;
TButton *Button1;
TButton *Button2;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
private: // User declarations
TForm2 *frm;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
나그네 님이 쓰신 글 :
: 첨부한 소스는 간단한 폼간 값넘기기 소스인데요..
: 주석처리한 부분
: ' TForm1 *frm; ' <= 이부분
: 에서 type name expeted 에러가 나네요.
: 뭐가 잘못된거예요?
|