|
이렇게해서 NULL값 넣어주는데도... 에러가뜨네요.. 방법좀알려주세요
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
TImage *I[100000];
AnsiString a;
int X=0;
int i=0;
TButton* cls;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
I[X] = new TImage(this);
I[X]->Name = String("Imgcnd_") + X + String("_");
I[X]->Width = 189;
I[X]->Height = 91;
I[X]->Stretch = true;
I[X]->AutoSize = false;
I[X]->Visible = true;
I[X]->Parent = Form1;
I[X]->Picture->LoadFromFile("C:WEFWEF.bmp");
I[X]->Left = X;
I[X]->Top = 0;
I[X]->Transparent = true;
X++;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
int i = 0;
delete Form1;
delete I[i];
for(int i = 0; i < 5; i++)
{
I[i]=NULL;
}
X = 0;
Application->CreateForm(__classid(TForm1), &Form1);
Form1->Show();
}
//---------------------------------------------------------------------------
|