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

1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions

1 Answers  


What is a message map, and what is the advantage of a message map over virtual functions?

1 Answers  


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

6 Answers  


How can we create thread in MFC framework?

3 Answers  


How to handle RTTI in MFC ?

1 Answers  


How can server communicate with more than one client

2 Answers   Invensys,


1)dynamic creation of a Button ?

2 Answers   TCS,


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header ("Include") Files.

3 Answers   ABC, HCL, Infosys,


What is the use of CCmdTarget ?

4 Answers  


what is functioning of DIalodDataXchange ..?

0 Answers  


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


1) How do you Destroy a Dialog Box ?

2 Answers   Honeywell,


Categories