Form won't close

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jan 2006
Posts: 8
Reputation: jimtaylor is an unknown quantity at this point 
Solved Threads: 0
jimtaylor jimtaylor is offline Offline
Newbie Poster

Form won't close

 
0
  #1
Mar 10th, 2006
There follows a fragment of a program in Borland C++:

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Memo1->Clear();
ListBox1->Clear();
Memo1->Lines->LoadFromFile("c:\\blitz\\history.txt");
a=Memo1->Lines->Count;
x=0;
while (x<a)
{
str1=Memo1->Lines->Strings[x];
if (str1 != "")
{
DATA MANIPULATION HERE, THEN

if (ListBox1->Items->Count==0)
ListBox1->Items->Strings[0]=str3;
else
ListBox1->Items->Add(str3);
}
}
ListBox1->Items->SaveToFile("C:\\blitz\\history.txt");
Close();
}

The form does not close, but "history.txt" is OK.

Any notions?

Jim Taylor
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 8
Reputation: jimtaylor is an unknown quantity at this point 
Solved Threads: 0
jimtaylor jimtaylor is offline Offline
Newbie Poster

Re: Form won't close

 
0
  #2
Mar 12th, 2006
Hey, I think I figured it out myself. It seems you can't Close() from an "On Create" situation.

Jim Taylor
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC