In MFC By Using Communication Between Dialog Boxes,How Can We Send Message Of one Dialog Box To Another Dialog.?

Answers were Sorted based on User's Feedback



In MFC By Using Communication Between Dialog Boxes,How Can We Send Message Of one Dialog Box To Anot..

Answer / alim

You can use Findwindow api to get the handle of other application and then use that handle n send message.

Is This Answer Correct ?    2 Yes 0 No

In MFC By Using Communication Between Dialog Boxes,How Can We Send Message Of one Dialog Box To Anot..

Answer / ali

You can also use Inter Process Communication between two dialog boxes. Read about OnCopyData method.

The SendMessage for WM_COPYDATA, they Handle to sender is an HWND

SendMessage((HWND) hWnd, // handle to destination window
WM_COPYDATA, // message to send
(WPARAM) wParam, // handle to window (HWND)
(LPARAM) lParam // data (PCOPYDATASTRUCT)
);
I hope this ll help you.

Is This Answer Correct ?    1 Yes 1 No

In MFC By Using Communication Between Dialog Boxes,How Can We Send Message Of one Dialog Box To Anot..

Answer / shiva

using application class we can store the data then we can retrieve that data example
if you're application like
in MyTabapplication.h
bool courses[3];
then dailog class
tab1.cpp
we can pass the data
void CTabOne::OnBnClickedCheck1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CMyTabExampleApp* myApp = (CMyTabExampleApp*)AfxGetApp();
myApp->courses[0] = m_CHK_EXE.GetCheck();
}
tab2.cpp
in you're 2 dailog box
CMyTabExampleApp* myApp = (CMyTabExampleApp*)AfxGetApp();
if(myApp->courses[0])
{
m_CHK_EXE.EnableWindow(TRUE);
//m_CHK_EXE.SetCheck(FALSE);
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MFC Interview Questions

what is the use of CWinApp class?

3 Answers   Mphasis,


if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first

10 Answers   Siemens, Symphony,


1) How do you Destroy a Dialog Box ?

2 Answers   Honeywell,


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,






How to update windows title bar dynamically?

7 Answers   HCL,


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


How can i implement the dynamic menus in MFC plz give the code

2 Answers  


1)does Frame Thickness in MFC?

1 Answers   winfoware,


What is LoadLibrary function returns?

7 Answers  


1)why we cant create more than one instance of the class Derived from CWinApp

5 Answers   Alstom,


Psychic Window Technique

2 Answers   E Logic, Wild Net,


Categories