View Full Version : Managed C++ (C++/CLR)
Latexxx
22nd April 2006, 16:08
I've been fooling around with Microsoft's free edition of Visual C++ lately. I've pretty much worked out how to write a .net Windows Forms application with it but yet I haven't really figured out a clean way to terminate my application. "delete this;" works but I really can't say I like the concept of writing that and if someboby could tell me a better way or say that there aren't any other options, I would be pretty pleased.
dimzon
22nd April 2006, 18:36
this.Close();
Latexxx
23rd April 2006, 08:44
this.Close();
Actually that would be C#. The correct version for C++ is this->Close().
But thanks.
Rasqual
27th April 2006, 02:46
System::Windows::Forms::Application::Exit();
as outlined here (http://geekswithblogs.net/mtreadwell/archive/2004/06/06/6123.aspx) "does not force the application to exit. The Exit method is typically called from within a message loop, and forces Run to return. "
Run being Application::Run(); generally used in the main() function to load the main form.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.