Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a few questions, the first is how can i transfer data from 1 dialog to another EG i hav 2 buttons on a dialog, click "button 1" and another dlg pops up. In that dlg there is a check box control, i click the check the box, when u hit ok on the dlg it closes and u r returned to the first dlg. Click on "button 2" on the first dlg and a messagebox will appear sayin, u checked the checkbox. I can make this happen all on 1 dlg but i don't no how to check if the control was clicked or not. Any suggestions
The other thing is, how can i make an MFC app without the MFC dll's, either by not linking the program to the dll's or to include the dll's in the EXE some how
Thanks a bunch

I believe you do it like this:
Say in the class of your second dialog, the one with the checkbox, you have a variable that relates to the status of the checkbox.
In the class for the first dialog, you should have a variable for the second dialog. You use this variable to call the DoModal() function of the second dialog. So, to get the value of the variable related to the status of that checkbox, you use the same variable. Kinda like this:
=========================================================================
//Assign a new variable to the second dialog's class
CMyDialog m_dDialog2;//Call the second dialog's domodal function to display the box
m_dDialog2.DoModal();//User checks or unchecks a checkbox, attached to the variable m_bCheckBox
//User returns to calling dialog by clicking OK
//Back to the original dialog, so get value of m_bCheckBox
if (m_dDialog2.m_bCheckBox == 1)
MessageBox("The box was checked.");
else
MessageBox("The box was not checked");
==========================================================================I think that should do it. You should be able to access any member of another dialog class by using a varialbe whos type is that class.

![]() |
WebBrowser control - VB6
|
About ADO..?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |