|
답변 감사합니다.
어디에 홀린 기분이네요.
그래서 노트북에서 테스트하던 걸 데스크탑에 그대로 복사해서 컴파일 실행해보니 되네요.
노트북에선 왜안됐는지 모르겠군요 . 혹 빌더가 잘못 깔렸는지도 의심해봐야겠습니다.
허정주 님이 쓰신 글 :
: 전 잘 되네요 -_-;;
: 복사해서 조금 수정해서 해봤어요
:
: //---------------------------------------------------------------------------
:
: #include <vcl.h>
: #pragma hdrstop
:
: #include "Unit1.h"
: //---------------------------------------------------------------------------
: #pragma package(smart_init)
: #pragma resource "*.dfm"
: TForm1 *Form1;
: //---------------------------------------------------------------------------
: __fastcall TForm1::TForm1(TComponent* Owner)
: : TForm(Owner)
: {
: }
: //---------------------------------------------------------------------------
: int nBt = 0;
: TButton *bt[1][100];
: void __fastcall TForm1::Button1Click(TObject *Sender)
: {
: String aStr;
: TComponent *cmpt;
: int i, nGb=0, nBt=0;
:
: {
: {
: bt[0][nBt] = new TButton(this);
: bt[0][nBt]->Parent = Form1;
: bt[0][nBt]->OnClick = ButtonControl;
: aStr.sprintf("%03d", nBt);
: bt[0][nBt]->Name = "bt"+aStr;
: nBt++;
: }
: }
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::ButtonControl(TObject *Sender)
: {
: TButton *bt;
: String aCmp;
: TComponent *cmpt;
:
: aCmp = dynamic_cast<TButton *>(Sender)->Name;
: cmpt = (TButton *)FindComponent(aCmp);
:
: //bt = (TButton *)Sender;
: if(cmpt != NULL)
: {
: ShowMessage(2);
: bt = (TButton *)cmpt;
: }
: else
: {
: ShowMessage(1);
: }
: }
|