Click here to Skip to main content
15,845,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WebSockets in native C++ (not managed) Pin
enhzflep19-Feb-12 13:19
enhzflep19-Feb-12 13:19 
QuestionSending message between objects Pin
aangerma16-Feb-12 10:16
aangerma16-Feb-12 10:16 
QuestionRe: Sending message between objects Pin
David Crow16-Feb-12 11:54
David Crow16-Feb-12 11:54 
AnswerRe: Sending message between objects Pin
aangerma16-Feb-12 20:42
aangerma16-Feb-12 20:42 
AnswerRe: Sending message between objects Pin
Albert Holguin16-Feb-12 19:15
professionalAlbert Holguin16-Feb-12 19:15 
AnswerRe: Sending message between objects Pin
enhzflep16-Feb-12 19:19
enhzflep16-Feb-12 19:19 
GeneralRe: Sending message between objects Pin
aangerma16-Feb-12 20:57
aangerma16-Feb-12 20:57 
GeneralRe: Sending message between objects Pin
enhzflep16-Feb-12 23:35
enhzflep16-Feb-12 23: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 11:35
JackDingler17-Feb-12 11:35 
QuestionControl Multiple Dialog boxes in SDI application Pin
johnjitu16-Feb-12 5:35
johnjitu16-Feb-12 5:35 
GeneralRe: Control Multiple Dialog boxes in SDI application Pin
David Crow16-Feb-12 5:39
David Crow16-Feb-12 5:39 
GeneralRe: Control Multiple Dialog boxes in SDI application Pin
johnjitu16-Feb-12 6:03
johnjitu16-Feb-12 6:03 
SuggestionRe: Control Multiple Dialog boxes in SDI application Pin
David Crow16-Feb-12 6:06
David Crow16-Feb-12 6:06 
Questionhow to add image in SDI Pin
sarfaraznawaz16-Feb-12 3:52
sarfaraznawaz16-Feb-12 3:52 
AnswerRe: how to add image in SDI Pin
Richard MacCutchan16-Feb-12 5:19
mveRichard MacCutchan16-Feb-12 5:19 
QuestionHow to create OLE object for MS Office Pin
LionAM16-Feb-12 0:31
LionAM16-Feb-12 0:31 
AnswerRe: How to create OLE object for MS Office Pin
CPallini16-Feb-12 1:36
mveCPallini16-Feb-12 1:36 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 5:51
LionAM16-Feb-12 5:51 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 6:59
LionAM16-Feb-12 6:59 
GeneralRe: How to create OLE object for MS Office Pin
CPallini16-Feb-12 10:23
mveCPallini16-Feb-12 10:23 
GeneralRe: How to create OLE object for MS Office Pin
LionAM16-Feb-12 22:04
LionAM16-Feb-12 22:04 
QuestionMFC Multiple Splitter for MDI Application Pin
SHWRRMSH16-Feb-12 0:29
SHWRRMSH16-Feb-12 0:29 
GeneralRe: MFC Multiple Splitter for MDI Application Pin
Jochen Arndt16-Feb-12 1:11
professionalJochen Arndt16-Feb-12 1:11 
GeneralRe: MFC Multiple Splitter for MDI Application Pin
SHWRRMSH16-Feb-12 1:16
SHWRRMSH16-Feb-12 1:16 
Questioncall C# function from C++ dll Pin
Paulraj G15-Feb-12 21:15
Paulraj G15-Feb-12 21: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.