Click here to Skip to main content
15,885,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEdit::SetHighlight Pin
leon de boer25-Aug-16 15:36
leon de boer25-Aug-16 15:36 
GeneralRe: CEdit::SetHighlight Pin
AlecJames26-Aug-16 0:10
AlecJames26-Aug-16 0:10 
QuestionHow to test a synchronization object for lock? Pin
Krishnakumartg18-Aug-16 19:02
Krishnakumartg18-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
Member 853403517-Aug-16 22:06 
AnswerRe: Controls in CPaneDialog (MFC) not Working Pin
Victor Nijegorodov23-Aug-16 3:37
Victor Nijegorodov23-Aug-16 3:37 
QuestionRe: Controls in CPaneDialog (MFC) not Working Pin
David Crow23-Aug-16 6:04
David Crow23-Aug-16 6:04 
AnswerRe: Controls in CPaneDialog (MFC) not Working Pin
Member 853403527-Aug-16 1:31
Member 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
C++
CListCtrl m_ListCtrl;

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


4. Added a Handler for WM_INITDIALOG

C++
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?
AnswerRe: Controls in CPaneDialog (MFC) not Working Pin
Couvert Gérard8-Feb-22 1:45
Couvert Gérard8-Feb-22 1:45 
GeneralRe: Controls in CPaneDialog (MFC) not Working Pin
Klaus Bucher20-Apr-22 23:57
Klaus Bucher20-Apr-22 23:57 
QuestionOwner Draw Static Control Freezes up application Pin
ForNow14-Aug-16 5:55
ForNow14-Aug-16 5:55 
AnswerRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow14-Aug-16 7:31
ForNow14-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
leon 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
ForNow16-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
ForNow16-Aug-16 3:04 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 4:07
David 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
leon 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
ForNow16-Aug-16 3:59 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 9:51
David Crow16-Aug-16 9:51 
GeneralRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 9:56
ForNow16-Aug-16 9:56 
QuestionRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
David Crow16-Aug-16 10:20
David Crow16-Aug-16 10:20 
AnswerRe: Owner Draw Static Control Freezes up application removed message map problem solved Pin
ForNow16-Aug-16 10:24
ForNow16-Aug-16 10:24 

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.