943,929 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 2835
  • C++ RSS
Mar 10th, 2006
0

Form won't close

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jimtaylor is offline Offline
8 posts
since Jan 2006
Mar 12th, 2006
0

Re: Form won't close

Hey, I think I figured it out myself. It seems you can't Close() from an "On Create" situation.

Jim Taylor
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jimtaylor is offline Offline
8 posts
since Jan 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Inserting in a sorted linked list(sorted alphabetically)
Next Thread in C++ Forum Timeline: C++ - std::string input





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC