Sorry for the following short story.<br><br>MainForm fsMDIForm - one menu opens lots of fsMDIChild forms<br><br>The File menu can open Form1(fsNormal) or Form2(fsNormal)<br><br>Form1 is Autocreated and receives data from a COM port using a Thread and writes to a file. The Thread is terminated in the FormCloseQuery routine after which CanClose is set true and the form is closed mode caHide. In the FormHide routine Form1->Visible is set false.<br><br>Form2 is Non-Autocreated and imports the data from the above file into tables in a database.<br><br>Problem:<br>Running these two forms from the main menu independently works OK and on terminating the program I get no error.<br><br>However, I also allow an autoupdate, if a button is checked, by Form1 opening Form2:<br><br>void __fastcall TForm1::FormHide(TObject *Sender)<br>{<br> frmForm1->Visible = false;<br> if (AutoUpdate)<br> {<br> TForm2 *Form2= new TForm2(this);<br> Form2->Show();<br> }<br>}<br><br>This all works fine and the rest of the program works fine. I can repeatedly input serial data and update. BUT, when I close the program I always get<br> EWin32Error message 'A Win32API function failed'<br> this is while executing an inline form destroy <br> /* TCustomForm.Destroy */<br>The error message is of course in the IDE with debug enabled.<br><br>I am using C++Builder 5 Professional but I've had the problem previously in version 3.<br><br>Anybody got any suggestions (other than jump)?<br><br>Roy Thomas<br><br>