Click here to Skip to main content
16,007,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DrawItem of HeaderCtrl Pin
5-Sep-01 4:13
suss5-Sep-01 4:13 
GeneralRe: DrawItem of HeaderCtrl Pin
Tomasz Sowinski5-Sep-01 4:21
Tomasz Sowinski5-Sep-01 4:21 
GeneralRe: DrawItem of HeaderCtrl Pin
5-Sep-01 4:44
suss5-Sep-01 4:44 
GeneralRe: DrawItem of HeaderCtrl Pin
Tomasz Sowinski5-Sep-01 4:26
Tomasz Sowinski5-Sep-01 4:26 
GeneralRe: DrawItem of HeaderCtrl Pin
5-Sep-01 4:46
suss5-Sep-01 4:46 
GeneralRe: DrawItem of HeaderCtrl Pin
Tomasz Sowinski5-Sep-01 4:58
Tomasz Sowinski5-Sep-01 4:58 
GeneralRe: DrawItem of HeaderCtrl Pin
5-Sep-01 20:12
suss5-Sep-01 20:12 
GeneralRe: DrawItem of HeaderCtrl Pin
Tomasz Sowinski6-Sep-01 0:43
Tomasz Sowinski6-Sep-01 0:43 
OK - I can see what's going wrong. The parent isn't subclassed by MFC. When static window receives WM_DRAWITEM, the message goes to DefWindowProc, not to CWnd::OnDrawItem.

The 'pStatic' pointer you're getting via GetDlgItem points to a temporary object, which is destroyed by MFC during idle processing.

You need member CStatic variable associated - change the id from IDC_STATIC to something else, IDC_HDR_PARENT and use ClassWizard to add a member control variable.

Optionally, add m_static manually to CYourDlg and call m_static.SubclassDlgItem(IDC_HDR_PARENT, this) in CYourDlg::OnInitDialog.

Tomasz Sowinski -- http://www.shooltz.com
GeneralRe: DrawItem of HeaderCtrl Pin
6-Sep-01 21:27
suss6-Sep-01 21:27 
GeneralA Simple Question Pin
4-Sep-01 22:11
suss4-Sep-01 22:11 
GeneralRe: A Simple Question Pin
Christian Graus5-Sep-01 1:22
protectorChristian Graus5-Sep-01 1:22 
Generalmukkie and all ! Question about the DLL. Please help !!!. Pin
4-Sep-01 20:26
suss4-Sep-01 20:26 
Generalextra explaination Pin
4-Sep-01 20:29
suss4-Sep-01 20:29 
GeneralRe: extra explaination Pin
4-Sep-01 21:21
suss4-Sep-01 21:21 
Generalexcuse me ! Pin
4-Sep-01 21:25
suss4-Sep-01 21:25 
GeneralRe: mukkie and all ! Question about the DLL. Please help !!!. Pin
Michael P Butler4-Sep-01 22:21
Michael P Butler4-Sep-01 22:21 
GeneralHow ?? Pin
4-Sep-01 22:28
suss4-Sep-01 22:28 
GeneralOK !! I added and it is not work !!!!! Pin
4-Sep-01 22:47
suss4-Sep-01 22:47 
GeneralRe: mukkie and all ! Question about the DLL. Please help !!!. Pin
5-Sep-01 3:37
suss5-Sep-01 3:37 
GeneralThank you Very very very much! It Is WORK !!! Pin
5-Sep-01 23:18
suss5-Sep-01 23:18 
GeneralRe: mukkie and all ! Question about the DLL. Please help !!!. Pin
Mukkie5-Sep-01 9:08
Mukkie5-Sep-01 9:08 
GeneralActiveX to Call Javascript/VBScript function Pin
sanskypotov4-Sep-01 19:58
sanskypotov4-Sep-01 19:58 
GeneralBattery Discharge problem Pin
Sandeep Shetty4-Sep-01 19:56
Sandeep Shetty4-Sep-01 19:56 
GeneralRe: Battery Discharge problem Pin
Anders Molin4-Sep-01 23:44
professionalAnders Molin4-Sep-01 23:44 
GeneralMediaplayer Pin
RichardWdy4-Sep-01 19:56
RichardWdy4-Sep-01 19:56 

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.