HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

CSftButton

Default constructor and destructor for the CSftButton MFC class. CSftButton derives from CWnd and follows MFC's standard window-object lifecycle: an instance is constructed, attached to (or used to create) a HWND, and destroyed.

C++

CSftButton::CSftButton();
CSftButton::~CSftButton();

Parameters

None.

Comments

The constructor takes no arguments and sets no state - the freshly constructed object is not yet attached to a window. Attach it by calling Create, by calling SubclassDlgItem on a button placed in a dialog template, or by casting the result of GetDlgItem.

The destructor calls DestroyWindow if the object is still attached to a HWND; in dialog-based scenarios where the HWND outlives the C++ object (for example a CSftButton temporary obtained from GetDlgItem) this is harmless because the HWND has already been destroyed by the dialog framework.

CSftButton instances created on the heap should be deleted by the application; instances embedded as data members of a dialog or view class are destroyed automatically when the owning class is destroyed.

See Also Create | RegisterApp | Using C++/MFC


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.