Click here to Skip to main content
15,910,877 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: bind data in List Box Pin
Cool_Dev2-Aug-10 18:28
Cool_Dev2-Aug-10 18:28 
QuestionRead String Pin
AbhiHcl2-Aug-10 3:30
AbhiHcl2-Aug-10 3:30 
AnswerRe: Read String Pin
«_Superman_»2-Aug-10 3:50
professional«_Superman_»2-Aug-10 3:50 
AnswerRe: Read String Pin
Aescleal2-Aug-10 3:51
Aescleal2-Aug-10 3:51 
AnswerRe: Read String Pin
Luc Pattyn2-Aug-10 3:57
sitebuilderLuc Pattyn2-Aug-10 3:57 
AnswerRe: Read String Pin
Chris Losinger2-Aug-10 4:14
professionalChris Losinger2-Aug-10 4:14 
GeneralRe: Read String Pin
Cedric Moonen2-Aug-10 4:33
Cedric Moonen2-Aug-10 4:33 
GeneralRe: Read String Pin
Iain Clarke, Warrior Programmer3-Aug-10 2:09
Iain Clarke, Warrior Programmer3-Aug-10 2:09 
AnswerRe: Read String Pin
Nemanja Trifunovic2-Aug-10 4:58
Nemanja Trifunovic2-Aug-10 4:58 
AnswerRe: Read String Pin
Moak2-Aug-10 5:20
Moak2-Aug-10 5:20 
GeneralRe: Read String Pin
Emilio Garavaglia2-Aug-10 20:25
Emilio Garavaglia2-Aug-10 20:25 
GeneralRe: Read String Pin
Moak2-Aug-10 22:26
Moak2-Aug-10 22:26 
GeneralRe: Read String Pin
Emilio Garavaglia3-Aug-10 20:17
Emilio Garavaglia3-Aug-10 20:17 
GeneralRe: Read String Pin
Moak3-Aug-10 22:22
Moak3-Aug-10 22:22 
QuestionCOM interface disappears from ROT [modified] Pin
Phil J Pearson2-Aug-10 1:09
Phil J Pearson2-Aug-10 1:09 
AnswerRe: COM interface disappears from ROT Pin
Code-o-mat2-Aug-10 1:18
Code-o-mat2-Aug-10 1:18 
GeneralRe: COM interface disappears from ROT Pin
Phil J Pearson2-Aug-10 1:51
Phil J Pearson2-Aug-10 1:51 
GeneralRe: COM interface disappears from ROT Pin
Code-o-mat2-Aug-10 1:59
Code-o-mat2-Aug-10 1:59 
GeneralRe: COM interface disappears from ROT Pin
Phil J Pearson2-Aug-10 2:07
Phil J Pearson2-Aug-10 2:07 
AnswerRe: COM interface disappears from ROT Pin
Phil J Pearson2-Aug-10 2:19
Phil J Pearson2-Aug-10 2:19 
GeneralRe: COM interface disappears from ROT Pin
Code-o-mat2-Aug-10 2:24
Code-o-mat2-Aug-10 2:24 
QuestionClistCtrl Pin
alexander 19831-Aug-10 23:59
alexander 19831-Aug-10 23:59 
AnswerRe: ClistCtrl Pin
«_Superman_»2-Aug-10 0:14
professional«_Superman_»2-Aug-10 0:14 
AnswerRe: ClistCtrl Pin
David Crow2-Aug-10 2:49
David Crow2-Aug-10 2:49 
AnswerRe: ClistCtrl Pin
bleedingfingers2-Aug-10 3:18
bleedingfingers2-Aug-10 3:18 
What others said is right. You have to store the data - the data that's supposed to be shown - elsewhere and in order to show that data in the control, you have to feed that, may be through the dialog object, may be something like this.

CMyDialog : public CDialog
{
public:
CMyDialog(CListCtrlData *pd):m_pd(pd)...
BOOL OnInitDialog(...)
{
//...
// fill the list ctrl with the data
//...
}
private:
CListCtrlData *m_pd;
};

CListCtrlData gDataA;

void SomeFunction()
{
CMyDialog dlg(&gDataA);
dlg.DoModal();
}

CListCtrlData gDataB;

void SomeOtherFunction()
{
CMyDialog dlg(&gDataB);
dlg.DoModal();
}


If the data is supposed to be editable, just make sure that your data class has appropriate methods to update and call these methods from the relevant event handlers for the control.
byte till it megahurtz

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.