Click here to Skip to main content
15,902,112 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralADO C++ Pin
edataonline17-May-04 4:39
edataonline17-May-04 4:39 
GeneralRe: ADO C++ Pin
Antony M Kancidrowski17-May-04 6:41
Antony M Kancidrowski17-May-04 6:41 
QuestionHow to build a DataBase of data types (int, char, struct, …)? Pin
Michigan185417-May-04 4:26
Michigan185417-May-04 4:26 
AnswerRe: How to build a DataBase of data types (int, char, struct, …)? Pin
David Crow17-May-04 4:46
David Crow17-May-04 4:46 
GeneralRe: How to build a DataBase of data types (int, char, struct, …)? Pin
Michigan185417-May-04 4:53
Michigan185417-May-04 4:53 
GeneralRe: How to build a DataBase of data types (int, char, struct, …)? Pin
David Crow17-May-04 5:50
David Crow17-May-04 5:50 
GeneralRe: How to build a DataBase of data types (int, char, struct, …)? Pin
Michigan185417-May-04 6:04
Michigan185417-May-04 6:04 
GeneralComboBox (and/or ListBox) shared in two dialogs (MFC) Pin
J.B.17-May-04 3:53
J.B.17-May-04 3:53 
Hello guys,

I need some suggestions on this.

I have two dialogs CDialog1 and CDialog2. CDialog1 has a ComboBox that contains a list of values. CDialog2 has a ListBox. The CDialog1 calls up CDialog2 using DoModal(). When the CDialog2 is up, its ListBox should be filled with the listed values in the ComboBox of the CDialog1 (of course, this would be done in the CDialog2's OnInitDialog()). Then in the CDialog2, the items in the ListBox can be changed and as soon as this dialog is closed (EndDialog()), the values in the ListBox will go back and replace the ones in the CDialog1's ComboBox.

As you can see, I need to either share these two members (likely via the use of DDX control) between the two dialogs or have the CDialog1's ComboBox fully accessible by the CDialog2.

I tried to create paired members (CComboBox or CListBox) in the other dialog for the original member, duplicate a copy and create functions to update the list on both sides whenever necessary. But the copying didn't work. I couldn't go, for example, in CDialog1 before calling DoModal,
CDialog2 dlg2;
dlg2.m_ComboBox = dlg1.m_ComboBox;
</code>


The other way I could think of is to use SendMessage() to retieve/update the ComboBox' values from CDialog2 to CDialog1. Or, I could simply make the ComboBox globally accessible through pointer for CDialog2.

Before I try anything, I'd really like to hear from anyone. What would be the best way (MS recommended way?)to go about it? Or could my first method be corrected?

Thanks alot
GeneralRe: ComboBox (and/or ListBox) shared in two dialogs (MFC) Pin
RChin17-May-04 4:31
RChin17-May-04 4:31 
GeneralRe: ComboBox (and/or ListBox) shared in two dialogs (MFC) Pin
J.B.17-May-04 4:45
J.B.17-May-04 4:45 
GeneralRe: ComboBox (and/or ListBox) shared in two dialogs (MFC) Pin
Rafael Fernández López17-May-04 9:42
Rafael Fernández López17-May-04 9:42 
GeneralRe: ComboBox (and/or ListBox) shared in two dialogs (MFC) Pin
J.B.17-May-04 19:54
J.B.17-May-04 19:54 
GeneralData mismatch for Intel C++ Release Pin
SandeepKumarSingh17-May-04 3:22
SandeepKumarSingh17-May-04 3:22 
GeneralRe: Data mismatch for Intel C++ Release Pin
bikram singh17-May-04 4:48
bikram singh17-May-04 4:48 
GeneralVC .DLL + Centura string Pin
JensB17-May-04 3:21
JensB17-May-04 3:21 
QuestionHow to change window title text font? Pin
george ivanov17-May-04 3:16
george ivanov17-May-04 3:16 
AnswerRe: How to change window title text font? Pin
Roger Allen17-May-04 3:44
Roger Allen17-May-04 3:44 
QuestionCan anyone explain? Pin
V.17-May-04 2:27
professionalV.17-May-04 2:27 
GeneralCompiler Error / math.h Pin
harwanegg17-May-04 2:03
harwanegg17-May-04 2:03 
GeneralRe: Compiler Error / math.h Pin
Roger Allen17-May-04 3:48
Roger Allen17-May-04 3:48 
GeneralRe: Compiler Error / math.h Pin
harwanegg17-May-04 5:34
harwanegg17-May-04 5:34 
GeneralDistributed, Concurrent, Networking Programming Pin
nguyenvhn17-May-04 1:04
nguyenvhn17-May-04 1:04 
GeneralRe: Distributed, Concurrent, Networking Programming Pin
valikac17-May-04 6:51
valikac17-May-04 6:51 
GeneralQuestion on Menu Events Pin
Abin17-May-04 0:30
Abin17-May-04 0:30 
GeneralRe: Question on Menu Events Pin
Michael Dunn17-May-04 0:45
sitebuilderMichael Dunn17-May-04 0: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.