Defining a custom *constructor* (not initializer!)

John Chapman johnch_atms at hotmail.com
Sat May 12 08:57:36 PDT 2012


> Yup, they do what C# does with the constructor: they put make a 
> *separate* function, createHandle(), used to create the control.
>
> And they simply *don't* tie the destructor to DestroyWindow(); 
> instead, they just assume the user will call dispose().>
> So in other words, they just ignored the entire problem with 
> the lifetimes, and hoped ("required"?) that the user will call 
> dispose().

Actually, in WinForms, closing the application's main Form
triggers its Dispose method, which disposes of child Controls too.


More information about the Digitalmars-d mailing list