|
smleelms 님이 쓰신 글 :
: Active Form과 Active Form에서 호출하는 폼이 있습니다.
:
: 두 폼의 헤더파일을 상호 인클루드 시켰구요, Active Form에서 버튼클릭시 호출폼을 모달로 호출하면 폼이 생성이 됩니다.
: 그런데 Active Form의 데이터를 호출폼에서 참조한다던지, 호출폼의 데이터를 Active Form으로 보낼려니 Access violation 에러가 납니다.
:
: 일반폼에서 서로 다른 폼의 데이터를 교환하듯이 그대로 프로그래밍을 했습니다.
: 컴파일 오류는 없는데 실행시 에러가 납니다.
:
: Active Form에서 생성한 폼과의 데이터 교환시 별도로 처리해줘야 될 내용이 있는지 궁금합니다.
: 아시는 분의 답변을 부탁드립니다.
// 혹 비슷할것 같아서 올립니다.
// 작동확인한 모달된 폼의 루틴입니다.
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "test.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Label1->Caption = "버튼1누름";
TEST1_PJT->Label2->Caption="버튼1";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Label1->Caption = "버튼2누름";
TEST1_PJT->Label2->Caption="버튼2"; // 현재의form 을 모달한 form class TEST1_PJT
}
//---------------------------------------------------------------------------
|