Click here to Skip to main content
15,888,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 9:46
azhari2413-Sep-11 9:46 
GeneralRe: Microsecond timer Pin
jschell13-Sep-11 11:42
jschell13-Sep-11 11:42 
GeneralRe: Microsecond timer [modified] Pin
azhari2413-Sep-11 18:57
azhari2413-Sep-11 18:57 
GeneralRe: Microsecond timer Pin
Erudite_Eric13-Sep-11 22:46
Erudite_Eric13-Sep-11 22:46 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 18:58
azhari2413-Sep-11 18:58 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 18:54
azhari2413-Sep-11 18:54 
QuestionGetting the handle of a PictureBox in MFC Pin
Tom Moore11-Sep-11 2:16
Tom Moore11-Sep-11 2:16 
AnswerRe: Getting the handle of a PictureBox in MFC Pin
Randor 11-Sep-11 3:34
professional Randor 11-Sep-11 3:34 
Tom,

Make sure that you are calling GetDlgItem(int) from the parent window of the CStatic because the MFC wrapper auto-populates the first HWND parameter with this->m_hWnd. You could also use the global namespace function ::GetDlgItem(HWND,int) if you want to call this function from outside the window class.

I would actually recommend that you avoid using GetDlgItem and instead use a control variable. In some cases the GetDlgItem function will return a pointer to a CTempWnd object. Another reason to void GetDlgItem is because of performance reasons... GetDlgItem causes the MFC framework to iterate through an internal handle map in an attempt at finding a permanent object. In some projects this map could contain several hundred or more handles. So if an engineer is using a function such as GetDlgItem from WM_PAINT handler or perhaps WM_TIMER they could potentially be iterating needlessly through this map dozens of times per second or more.

Best Wishes,
-David Delaune
QuestionHow to use the hook function of Windows FileOpen dialog Pin
clever10110-Sep-11 1:29
clever10110-Sep-11 1:29 
AnswerRe: How to use the hook function of Windows FileOpen dialog Pin
Philippe Mori10-Sep-11 16:25
Philippe Mori10-Sep-11 16:25 
QuestionLive video processing Pin
Smith#9-Sep-11 21:32
Smith#9-Sep-11 21:32 
AnswerRe: Live video processing Pin
Richard MacCutchan9-Sep-11 23:02
mveRichard MacCutchan9-Sep-11 23:02 
AnswerRe: Live video processing Pin
barneyman11-Sep-11 17:58
barneyman11-Sep-11 17:58 
QuestionMFC CTabCtrl problems in VS2010 Pin
j_schultz9-Sep-11 11:28
j_schultz9-Sep-11 11:28 
AnswerRe: MFC CTabCtrl problems in VS2010 Pin
TheGreatAndPowerfulOz9-Sep-11 12:00
TheGreatAndPowerfulOz9-Sep-11 12:00 
GeneralRe: MFC CTabCtrl problems in VS2010 Pin
j_schultz12-Sep-11 9:38
j_schultz12-Sep-11 9:38 
QuestionHow to create a object of mainframe in application class Pin
Amrit Agr9-Sep-11 1:43
Amrit Agr9-Sep-11 1:43 
AnswerRe: How to create a object of mainframe in application class Pin
Code-o-mat9-Sep-11 2:24
Code-o-mat9-Sep-11 2:24 
QuestionHow to check i am clicking on the header of the list control Pin
Amrit Agr8-Sep-11 5:49
Amrit Agr8-Sep-11 5:49 
QuestionRe: How to check i am clicking on the header of the list control Pin
David Crow8-Sep-11 5:52
David Crow8-Sep-11 5:52 
AnswerRe: How to check i am clicking on the header of the list control [modified] Pin
Chuck O'Toole8-Sep-11 11:50
Chuck O'Toole8-Sep-11 11:50 
Questionquestion with locale [modified] Pin
Cold_Fearing_Bird8-Sep-11 4:38
Cold_Fearing_Bird8-Sep-11 4:38 
QuestionCRichEditCtrl Pin
john56328-Sep-11 2:33
john56328-Sep-11 2:33 
AnswerRe: CRichEditCtrl Pin
Orjan Westin8-Sep-11 3:15
professionalOrjan Westin8-Sep-11 3:15 
GeneralRe: CRichEditCtrl Pin
john56328-Sep-11 19:02
john56328-Sep-11 19:02 

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.