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

Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


What is CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example

6 Answers  


What is the base class for most MFC classes?

7 Answers   CMC, Siemens,


what is message loop how mfc does it internally?

4 Answers   Aspire,


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


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

3 Answers   Financial Technologies,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,


1)does Frame Thickness in MFC?

1 Answers   winfoware,


What is the difference between GetMessage and PeekMessage ?

3 Answers  


Difference between Cclint DC & Cpaint Dc

6 Answers   E Logic,


how does the UIThread and worker thread communicates and handle events

2 Answers   HCL,


How can server communicate with more than one client

2 Answers   Invensys,


Categories