简体   繁体   中英

messages for cstatic

1.i have derived a class from CStatic called CLed_arr. 2.a cstatic control named IDC_leds was added to the dialog window in resource editor. 3.a member var called m_led_arr of the class CLed_arr was created for this IDC_leds. 4.the class CLed_arr contains an array Led[16] of objects of class CLed. 5.the class CLed itself is derived from CStatic. 6.i did'nt want to put these 16 led windows in resource editor,but wanted to create them at run time.for creation of these 16 windows the co-ordinates of the mother window ieIDC_leds are required.i tried the creation process in the CLed_arr constructor.but probably at this instant the window of the class is not available so i get exception.so i wanted to do it using some message handler using the creation the window message of this class ie CLed_arr.but the only message available for this class is BN_CLICKED.

7.pls help me in understanding as to why only BN_CLICKED message is available for this window,also what is the method if any available for adding additional messages for this window. 8.i'm able to create these 16 windows if i create them in OnitDialog(),but i want to develop this CLed_arr as a class whose basic procedures are within the class.

pls. hlp.

thnx

In MFC CWnd is the base class for most of the UI classes, for CStatic as well ofcourse. So try handling WM_CREATE msg from CWnd. It will come once the window is created but just before it gets visible. For more information see here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM