MFC - Adding event handler for dialog button -


i have cview class , dialog in it, , want data dialog object once user clicks on "accept" button, have added event button , handler in cview class, done through visual studio 2010 menus, haven't screwed code.

cview clas:

begin_message_map(csurface3dview, cview)   on_bn_clicked(id_range_ok, &csurface3dview::onbnclickedrangeok) end_message_map()    ... void csurface3dview::onbnclickedrangeok() {  //things need  } 

the thing is, doesn't call onbnclickedrangeok() function when ok button clicked.

i call function cview class dialog class, can't use instance parent class because need include header , causes circular inclusion, can solved declaring cview class in dialog header without including it, methods can't accesed.

maybe it's not possible put message handle dialog button outside dialog class? how run function in cview class when dialog button pressed?

edit:

well it's solved now, used sendmessage(hwnd, message ,...) method of cdialog send message parent pointer in constructor of cdialog, don't have declare specific class of parent , don't inclusion problems.

the specifics found here: http://forums.codeguru.com/showthread.php?385590-how-to-sendmessage-from-child-window-to-parent


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -