Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Partial Template Specialization? Pin
Jamie Hale20-Feb-02 6:36
Jamie Hale20-Feb-02 6:36 
GeneralProblem with Class View VC++ 6 Pin
Mike Gaskey19-Feb-02 5:37
Mike Gaskey19-Feb-02 5:37 
GeneralRe: Problem with Class View VC++ 6 Pin
Rage19-Feb-02 5:43
professionalRage19-Feb-02 5:43 
GeneralRe: Problem with Class View VC++ 6 Pin
Jamie Hale19-Feb-02 6:25
Jamie Hale19-Feb-02 6:25 
GeneralRe: Problem with Class View VC++ 6 Pin
J Patel19-Feb-02 7:02
J Patel19-Feb-02 7:02 
GeneralAccessing Dialog Data in MFC Pin
Rage19-Feb-02 5:32
professionalRage19-Feb-02 5:32 
GeneralRe: Accessing Dialog Data in MFC Pin
Nish Nishant19-Feb-02 5:52
sitebuilderNish Nishant19-Feb-02 5:52 
GeneralRe: Accessing Dialog Data in MFC Pin
Derek Waters19-Feb-02 11:32
Derek Waters19-Feb-02 11:32 
While Nish's answer is strictly correct, I would suggest (from an OO point of view) that this might be a bit safer:

In the CChild class, add a member function called Create, for example, which takes all of the parameters that you would normally need for a Create call and then a CListCtrl pointer as well:

BOOL CChild::Create(CListCtrl *apListCtrl, UINT nIDTemplate, CWnd *pParentWnd)
{
  if (CDialog::Create(nIDTemplate, pParentWnd))
  {
    m_pListCtrl = apListCtrl;
    return TRUE;
  }
  return FALSE;
}


where m_pListCtrl is a CListCtrl * member variable. You can then use this at will without having to rely on calls to AfxGetMainWnd(). Not only does this ensure that the correct list control is used, it means you don't have to make the CListCtrl public in your main dialog class.


------------------------
Derek Waters
derek@lj-oz.com
GeneralRe: Accessing Dialog Data in MFC Pin
Rage19-Feb-02 21:57
professionalRage19-Feb-02 21:57 
GeneralRe: Accessing Dialog Data in MFC Pin
Derek Waters20-Feb-02 11:21
Derek Waters20-Feb-02 11:21 
GeneralProblems with IMessageFilter in SDI Pin
Fredrik Skog19-Feb-02 4:42
Fredrik Skog19-Feb-02 4:42 
GeneralRe: Problems with IMessageFilter in SDI Pin
Fredrik Skog21-Feb-02 0:33
Fredrik Skog21-Feb-02 0:33 
GeneralBeginner Dialog::OnOK() Question Pin
CreekDawg19-Feb-02 4:28
CreekDawg19-Feb-02 4:28 
GeneralRe: Beginner Dialog::OnOK() Question Pin
v_krishnan19-Feb-02 4:34
v_krishnan19-Feb-02 4:34 
GeneralRe: Beginner Dialog::OnOK() Question Pin
Joaquín M López Muñoz19-Feb-02 4:35
Joaquín M López Muñoz19-Feb-02 4:35 
GeneralRe: Beginner Dialog::OnOK() Question Pin
Roger Allen19-Feb-02 4:37
Roger Allen19-Feb-02 4:37 
GeneralRe: Beginner Dialog::OnOK() Question Pin
lucy19-Feb-02 9:52
lucy19-Feb-02 9:52 
GeneralMaking a CRichEditView Readonly Pin
v_krishnan19-Feb-02 4:10
v_krishnan19-Feb-02 4:10 
GeneralRe: Making a CRichEditView Readonly Pin
Mazdak19-Feb-02 4:53
Mazdak19-Feb-02 4:53 
GeneralJet OLE DB 4 and PROPVARIANT Pin
peterchen19-Feb-02 4:06
peterchen19-Feb-02 4:06 
GeneralRe: Jet OLE DB 4 and PROPVARIANT Pin
Steen Krogsgaard19-Feb-02 23:41
Steen Krogsgaard19-Feb-02 23:41 
GeneralCString and Variant Pin
Mazdak19-Feb-02 2:51
Mazdak19-Feb-02 2:51 
GeneralRe: CString and Variant Pin
Joel Lucsy19-Feb-02 3:05
Joel Lucsy19-Feb-02 3:05 
GeneralRe: CString and Variant Pin
Mazdak19-Feb-02 5:14
Mazdak19-Feb-02 5:14 
GeneralRe: CString and Variant Pin
Joel Lucsy19-Feb-02 15:37
Joel Lucsy19-Feb-02 15:37 

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.