Click here to Skip to main content
14,981,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEdit::SetHighlight Pin
leon de boer25-Aug-16 15:36
Memberleon de boer25-Aug-16 15:36 
GeneralRe: CEdit::SetHighlight Pin
AlecJames26-Aug-16 0:10
MemberAlecJames26-Aug-16 0:10 
QuestionHow to test a synchronization object for lock? Pin
Krishnakumartg18-Aug-16 19:02
MemberKrishnakumartg18-Aug-16 19:02 
AnswerRe: How to test a synchronization object for lock? Pin
Jochen Arndt18-Aug-16 22:06
professionalJochen Arndt18-Aug-16 22:06 
QuestionControls in CPaneDialog (MFC) not Working Pin
Member 853403517-Aug-16 22:06
MemberMember 853403517-Aug-16 22:06 
AnswerRe: Controls in CPaneDialog (MFC) not Working Pin
Victor Nijegorodov23-Aug-16 3:37
MemberVictor Nijegorodov23-Aug-16 3:37 
QuestionRe: Controls in CPaneDialog (MFC) not Working Pin
David Crow23-Aug-16 6:04
MemberDavid Crow23-Aug-16 6:04 
AnswerRe: Controls in CPaneDialog (MFC) not Working Pin
Member 853403527-Aug-16 1:31
MemberMember 853403527-Aug-16 1:31 
sorry for the late reply...I was absent a while!

in the meantime I lost my first trail project and did it again, somehow differently Wink | ;)

but it is still not working!

My steps in detail:

1. Using the original source code from VS Gesture Demo
2. Adding a ListControl to the IDD_OPTIONS Dialog resource (report style) ID: IDC_LIST_INPANE
3. doing the same what the framework would do automatically for a standard dialog:
- in OptionPane.h I added
CListCtrl m_ListCtrl;

- in OptionPane.cpp in DoDataExchange
DDX_Control(pDX, IDC_LIST_INPANE, m_ListCtrl);


4. Added a Handler for WM_INITDIALOG

LRESULT COptionsPane::HandleInitDialog(WPARAM wParam,LPARAM lParam)
{
   UNREFERENCED_PARAMETER(wParam);
   UNREFERENCED_PARAMETER(lParam);

   m_ListCtrl.InsertColumn(0,_T("Col1"),LVCFMT_LEFT,50);
   m_ListCtrl.InsertColumn(1,_T("Col2"),LVCFMT_LEFT,50);

   int nItem;
   nItem = m_ListCtrl.InsertItem(MAXINT,_T("Item1"));


that's quite all!

Now, when I am starting the program, I will get an assertion in HandleInitDialog at the first access of m_ListCtrl. It seems m_hWnd is not valid at this moment.

What I need to do additionally in comparison to CDialog (where I initialize the control in OnInitDialog())
Is CPaneDialog::HandleInitDialog the wrong place for initialization of controls?
QuestionOwner Draw Static Control Freezes up application Pin
ForNow14-Aug-16 5:55
MemberForNow14-Aug-16 5:55 
AnswerRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow14-Aug-16 7:31
MemberForNow14-Aug-16 7:31 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
leon de boer15-Aug-16 21:11
Memberleon de boer15-Aug-16 21:11 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
Richard MacCutchan15-Aug-16 23:57
mveRichard MacCutchan15-Aug-16 23:57 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 2:02
MemberForNow16-Aug-16 2:02 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
Richard MacCutchan16-Aug-16 3:00
mveRichard MacCutchan16-Aug-16 3:00 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 3:04
MemberForNow16-Aug-16 3:04 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 4:07
MemberDavid Crow16-Aug-16 4:07 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
Richard MacCutchan16-Aug-16 5:27
mveRichard MacCutchan16-Aug-16 5:27 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
leon de boer16-Aug-16 3:37
Memberleon de boer16-Aug-16 3:37 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 3:59
MemberForNow16-Aug-16 3:59 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 9:51
MemberDavid Crow16-Aug-16 9:51 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 9:56
MemberForNow16-Aug-16 9:56 
QuestionRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 10:20
MemberDavid Crow16-Aug-16 10:20 
AnswerRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 10:24
MemberForNow16-Aug-16 10:24 
QuestionRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 10:29
MemberDavid Crow16-Aug-16 10:29 
AnswerRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 10:37
MemberForNow16-Aug-16 10: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.