Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 11:07
bolivar12322-Jul-09 11:07 
AnswerRe: [mfc] ip address control Pin
Maximilien22-Jul-09 8:17
Maximilien22-Jul-09 8:17 
QuestionDerived classes in MFC Pin
Penfold82121-Jul-09 23:48
Penfold82121-Jul-09 23:48 
AnswerRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 0:40
Code-o-mat22-Jul-09 0:40 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 1:01
Penfold82122-Jul-09 1:01 
GeneralRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 1:39
Code-o-mat22-Jul-09 1:39 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 2:52
Penfold82122-Jul-09 2:52 
GeneralRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 3:26
Code-o-mat22-Jul-09 3:26 
Does your second dialog know of the first dialog? Is it its parent for example? Then you could try overwriting the OnCommand[^] method of the second dialog's class (it doesn't even have to be a subclass of the original dialog's class). So something like this:
BOOL CMySecondDialog::OnCommand(WPARAM wParam, LPARAM lParam)
{
  GetParent()->SendMessage(WM_COMMAND, wParam, lParam);
  return TRUE;
}
Of course this carries some risks...a more safer aproach is maybe adding message handlers to your buttons and then relaying the events from there. Since we are talking about a few buttons only, it should be easy:
BEGIN_MESSAGE_MAP(CMySecondDialog, CDialog)
  ON_COMMAND(IDC_FIRSTBUTTON, OnFirstButton)
  ON_COMMAND(IDC_SECONDBUTTON, OnSecondButton)
  ...
END_MESSAGE_MAP()

void CMySecondDialog::RelayCommand(UINT nID)
{
  GetParent()->SendMessage(WM_COMMAND, nID, 0);
}

void CMySecondDialog::OnFirstButton()
{
  RelayCommand(IDC_FIRSTBUTTON);
}

void CMySecondDialog::OnSecondButton()
{
  RelayCommand(IDC_SECONDBUTTON);
}

I am not completely sure i understood your situation correctly though...

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <

GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 3:40
Penfold82122-Jul-09 3:40 
QuestionNeed help in accessment Pin
funjoke8821-Jul-09 23:32
funjoke8821-Jul-09 23:32 
AnswerRe: Need help in accessment Pin
_AnsHUMAN_ 21-Jul-09 23:40
_AnsHUMAN_ 21-Jul-09 23:40 
AnswerRe: Need help in accessment Pin
Michael Schubert21-Jul-09 23:45
Michael Schubert21-Jul-09 23:45 
AnswerRe: Need help in accessment Pin
Cedric Moonen21-Jul-09 23:57
Cedric Moonen21-Jul-09 23:57 
AnswerRe: Need help in accessment Pin
#realJSOP22-Jul-09 0:22
professional#realJSOP22-Jul-09 0:22 
Questiondisabling devices Pin
Subrat Patnaik21-Jul-09 23:30
Subrat Patnaik21-Jul-09 23:30 
AnswerRe: disabling devices Pin
Adam Roderick J22-Jul-09 2:41
Adam Roderick J22-Jul-09 2:41 
GeneralRe: disabling devices Pin
Subrat Patnaik22-Jul-09 19:07
Subrat Patnaik22-Jul-09 19:07 
AnswerRe: disabling devices Pin
Adam Roderick J22-Jul-09 22:40
Adam Roderick J22-Jul-09 22:40 
GeneralRe: disabling devices Pin
Subrat Patnaik23-Jul-09 23:56
Subrat Patnaik23-Jul-09 23:56 
QuestionHow to make report Pin
Max++21-Jul-09 23:26
Max++21-Jul-09 23:26 
AnswerRe: How to make report Pin
_AnsHUMAN_ 21-Jul-09 23:42
_AnsHUMAN_ 21-Jul-09 23:42 
QuestionHowto check xp was shutdown correctly Pin
tetzschner21-Jul-09 22:59
tetzschner21-Jul-09 22:59 
AnswerRe: Howto check xp was shutdown correctly [modified] Pin
Adam Roderick J22-Jul-09 2:32
Adam Roderick J22-Jul-09 2:32 
GeneralRe: Howto check xp was shutdown correctly Pin
tetzschner23-Jul-09 2:51
tetzschner23-Jul-09 2:51 
QuestionSend scsi command to usb device using DeviceIoControl method Pin
Nekkantidivya21-Jul-09 22:45
Nekkantidivya21-Jul-09 22:45 

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.