Click here to Skip to main content
16,012,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSet font Info for TextOut function Pin
Abd.Eskandari24-Jul-05 5:49
Abd.Eskandari24-Jul-05 5:49 
Questionwhat means -1.#IND000? Pin
gabriel.fischer24-Jul-05 4:52
gabriel.fischer24-Jul-05 4:52 
AnswerRe: what means -1.#IND000? Pin
Chris Losinger24-Jul-05 5:01
professionalChris Losinger24-Jul-05 5:01 
AnswerRe: what means -1.#IND000? Pin
toxcct24-Jul-05 5:30
toxcct24-Jul-05 5:30 
GeneralActive Document Server HELP! Pin
Bruce Pataki24-Jul-05 0:46
Bruce Pataki24-Jul-05 0:46 
GeneralRe: Active Document Server HELP! Pin
Gary R. Wheeler24-Jul-05 3:16
Gary R. Wheeler24-Jul-05 3:16 
GeneralRe: Active Document Server HELP! Pin
Bruce Pataki25-Jul-05 4:47
Bruce Pataki25-Jul-05 4:47 
GeneralRe: Active Document Server HELP! Pin
Gary R. Wheeler25-Jul-05 15:41
Gary R. Wheeler25-Jul-05 15:41 
The member variable m_hWnd is the window handle for your list control. If the window handle isn't valid, it usually means that either the control doesn't exist (in which case GetDlgItem() would return NULL), or the control hasn't been created yet.

As a rule, you need to be somewhat careful using a cast "CListCtrl *pList = (CListCtrl *)GetDlgItem(IDC_List1)" like you're doing. MFC support for the basic Windows controls (static, edit, and so on) are simple wrappers where the wrappers just send messages using the window handle. The MFC object itself doesn't add much. The common controls, on the other hand, are more complicated, and the MFC object may carry around more than the window handle. You are better off using something like this:
// in your dialog header file:
CListCtrl List;
// in your OnInitDialog function:
List.SubclassDlgItem(IDC_List1,this);
This permanently attaches the list control in your dialog resource with the ID IDC_List1 to a member variable List.


Software Zen: delete this;
GeneralRe: Active Document Server HELP! Pin
Bruce Pataki26-Jul-05 7:35
Bruce Pataki26-Jul-05 7:35 
GeneralRe: Active Document Server HELP! Pin
Gary R. Wheeler27-Jul-05 12:26
Gary R. Wheeler27-Jul-05 12:26 
Generalinterrupt handling Pin
rottencheese24-Jul-05 0:38
rottencheese24-Jul-05 0:38 
GeneralRe: interrupt handling Pin
Alexander M.,24-Jul-05 3:14
Alexander M.,24-Jul-05 3:14 
QuestionHow to expand CRectTracker's handles size for easy use with touch panel? Pin
yyqqhy200024-Jul-05 0:23
yyqqhy200024-Jul-05 0:23 
AnswerRe: How to expand CRectTracker's handles size for easy use with touch panel? Pin
Gary R. Wheeler24-Jul-05 3:20
Gary R. Wheeler24-Jul-05 3:20 
GeneralRe: How to expand CRectTracker's handles size for easy use with touch panel? Pin
Anonymous24-Jul-05 4:18
Anonymous24-Jul-05 4:18 
QuestionPop up "view wireless Network dialog" by Code? Pin
joycenter24-Jul-05 0:01
joycenter24-Jul-05 0:01 
Generalthe problem wtih AfxOleInit and OleUninitialize Pin
I am ke xu23-Jul-05 23:59
I am ke xu23-Jul-05 23:59 
Generalacessing msconfig in win9x,,nt,2000,xp Pin
Member 213961923-Jul-05 21:26
Member 213961923-Jul-05 21:26 
GeneralRe: acessing msconfig in win9x,,nt,2000,xp Pin
Alexander M.,24-Jul-05 3:16
Alexander M.,24-Jul-05 3:16 
GeneralRe: acessing msconfig in win9x,,nt,2000,xp Pin
Member 213961924-Jul-05 7:22
Member 213961924-Jul-05 7:22 
Generalchanu1982@rediffmail.comacessing msconfig in win9x,,nt,2000,xp Pin
Member 213961923-Jul-05 21:25
Member 213961923-Jul-05 21:25 
Generalhiding folders and files Pin
Member 213961923-Jul-05 21:20
Member 213961923-Jul-05 21:20 
GeneralRe: hiding folders and files Pin
Alexander M.,24-Jul-05 3:18
Alexander M.,24-Jul-05 3:18 
GeneralRe: hiding folders and files Pin
Member 213961924-Jul-05 7:53
Member 213961924-Jul-05 7:53 
QuestionIs the application running? Pin
picasso223-Jul-05 19:27
picasso223-Jul-05 19:27 

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.