Click here to Skip to main content
16,005,138 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WebSockets in native C++ (not managed) Pin
enhzflep19-Feb-12 12:19
enhzflep19-Feb-12 12:19 
QuestionSending message between objects Pin
aangerma16-Feb-12 9:16
aangerma16-Feb-12 9:16 
QuestionRe: Sending message between objects Pin
David Crow16-Feb-12 10:54
David Crow16-Feb-12 10:54 
AnswerRe: Sending message between objects Pin
aangerma16-Feb-12 19:42
aangerma16-Feb-12 19:42 
AnswerRe: Sending message between objects Pin
Albert Holguin16-Feb-12 18:15
professionalAlbert Holguin16-Feb-12 18:15 
AnswerRe: Sending message between objects Pin
enhzflep16-Feb-12 18:19
enhzflep16-Feb-12 18:19 
GeneralRe: Sending message between objects Pin
aangerma16-Feb-12 19:57
aangerma16-Feb-12 19:57 
GeneralRe: Sending message between objects Pin
enhzflep16-Feb-12 22:35
enhzflep16-Feb-12 22:35 
That's okay. In fact - I didn't make any call to the method of object 2. Please accept my apology for being unclear.

As I alluded to earlier, I can see two places where such a call would make sense.
In the first case, there would be action immediately after a radio button was pressed.
I imagine you would not have the same need to keep track of the currently selected option, so I've omitted that code from the following case statements.

Example 1: Immediate response
C++
case IDC_RADIO1:
    object2.handleSelectedRadioButton(1);
    return true;

case IDC_RADIO2:
    object2.handleSelectedRadioButton(2);
    return true;

case IDC_RADIO3:
    object2.handleSelectedRadioButton(3);
    return true;


In this second example, you'll need to remember which radio-button is selected somewhere, before taking the appropriate action when the trigger is received (in this case, the pressing of the button labelled Test)
Example 2: Action taken in response to another input
C++
case IDC_BTN_TEST:
              if (curRadioOption == -1)
                  MessageBox(hwndDlg, "Select a radio button first!", "Error", MB_ICONERROR);
              else
                   object2.handleSelectedRadioButton(curRadioOption);
              return TRUE;


Something else I should mention, is that MFC will most likely allow the state of any control to be quickly and easily queried (not sure if there's an object used to represent a group of radio buttons - I'd imagine that there was) This will make my global variable curRadioOption redundant.
AnswerRe: Sending message between objects Pin
JackDingler17-Feb-12 10:35
JackDingler17-Feb-12 10:35 
QuestionControl Multiple Dialog boxes in SDI application Pin
johnjitu16-Feb-12 4:35
johnjitu16-Feb-12 4:35 
GeneralRe: Control Multiple Dialog boxes in SDI application Pin
David Crow16-Feb-12 4:39
David Crow16-Feb-12 4:39 
GeneralRe: Control Multiple Dialog boxes in SDI application Pin
johnjitu16-Feb-12 5:03
johnjitu16-Feb-12 5:03 
SuggestionRe: Control Multiple Dialog boxes in SDI application Pin
David Crow16-Feb-12 5:06
David Crow16-Feb-12 5:06 
Questionhow to add image in SDI Pin
sarfaraznawaz16-Feb-12 2:52
sarfaraznawaz16-Feb-12 2:52 
AnswerRe: how to add image in SDI Pin
Richard MacCutchan16-Feb-12 4:19
mveRichard MacCutchan16-Feb-12 4:19 
QuestionHow to create OLE object for MS Office Pin
LionAM15-Feb-12 23:31
LionAM15-Feb-12 23:31 
AnswerRe: How to create OLE object for MS Office Pin
CPallini16-Feb-12 0:36
mveCPallini16-Feb-12 0:36 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 4:51
LionAM16-Feb-12 4:51 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 5:59
LionAM16-Feb-12 5:59 
GeneralRe: How to create OLE object for MS Office Pin
CPallini16-Feb-12 9:23
mveCPallini16-Feb-12 9:23 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 21:04
LionAM16-Feb-12 21:04 
QuestionMFC Multiple Splitter for MDI Application Pin
SHWRRMSH15-Feb-12 23:29
SHWRRMSH15-Feb-12 23:29 
GeneralRe: MFC Multiple Splitter for MDI Application Pin
Jochen Arndt16-Feb-12 0:11
professionalJochen Arndt16-Feb-12 0:11 
GeneralRe: MFC Multiple Splitter for MDI Application Pin
SHWRRMSH16-Feb-12 0:16
SHWRRMSH16-Feb-12 0:16 
Questioncall C# function from C++ dll Pin
Paulraj G15-Feb-12 20:15
Paulraj G15-Feb-12 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.