CHeaderCtrl is abnormal when release compilation.
"tody.lu" <tody.lu-/[email protected]> Mon, 02 Jul 2012 13:50:24 -0000
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
I save one integer value in Column of ListCtrl via "SetItem";
But I can't get the value via "GetItem" if the application is complied using "Release" configuration.
my test environment is vs2010 and vs2008.
the sample code is below:
===========================================
// m_ListCtrl is CListViewCtrl object.
m_ListCtrl.SubclassWindow(::GetDlgItem(m_hWnd, IDC_LIST1));
CHeaderCtrl header = m_ListCtrl.GetHeaderCtrl();
m_ListCtrl.InsertColumn(0, _T("Hello"), 0, 80);
HDITEM hd = {0};
int tt = 50;
BOOL ret;
hd.mask = HDI_FILTER;
hd.type = HDFT_ISNUMBER;
hd.pvFilter = &tt;
ret = header.SetItem(0, &hd);
if (ret != TRUE)
{
::MessageBox(m_hWnd, _T("wrong1"), NULL, 0);
}
HDITEM hh = {0};
int ss = 0;
hh.mask = HDI_FILTER;
hh.type = HDFT_ISNUMBER;
hh.pvFilter = &ss;
ret= header.GetItem(0, &hh); // return FALSE when release.
if (ret != TRUE)
{
::MessageBox(m_hWnd, _T("wrong2"), NULL, 0);
}
if (ss != tt)
{
::MessageBox(m_hWnd, _T("wrong3"), NULL, 0);
}
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wtl/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/wtl/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/