My code seems to be leaking memory. when i use HDM_GETITEMW, any thoughts? HDITEM hdItem; HDTEXTFILTER hdTFilter; TCHAR cFilter[1024]; hdItem.mask = ( HDI_FILTER ); // Set Mask ZeroMemory( cFilter, sizeof( cFilter ) ); // Init Buffer For Filter hdTFilter.pszText = cFilter; // Set Buffer For Filter hdTFilter.cchTextMax = sizeof( cFilter ); // Set Size Of Buffer hdItem.type = HDFT_ISSTRING; // Set String Filter Type hdItem.pvFilter = &hdTFilter ::SendMessage(pHeader -> m_hWnd, HDM_GETITEMW,iColNo, (LPARAM)&hdItem); // Get Item Filter DataReply
i downloaded this demo project, it is working on my system very well, but when i wrote my own code like this then there are so many errors like HDS_FILTERBAR , HDI_FILTER and hdItem.type = HDFT_ISSTRING not define. there are many other errors like this please helpe my email id is bharat.singh@sisl.co.in
You need to have the updated SDK installed correctly to have those values available. -=- James
ReplyOriginally posted by: Sajid Majid
Hi All,
On button click I am creating ListBox & then selecting value to filter. The selected value is set in filter using SetItem(...). This is ok, I can delete some chars from set value but can't enter if more than 4 char in edit. I have found this problem when I have set value for column from list, otherwise u can edit with keyboard without any problem.
Hope any one have any solution?.
Regards.
Majid.
Originally posted by: Kyle Sluder
When my program calls pHeader->SetItem() I get an Access Violation in Comctl32.dll... is something going on with SetItem? I'm running VC++ 6 Standard, Win98 SE, IE6, and Office 2000 Pro.
Also, how do I filter the list? In your demo app (which works without an access violation) I enter a filter into the FilterBar (example: Car) and click on the filter icon, but it doesn't want to work... I still get all the Bucket items, for example.
ReplyOriginally posted by: Stephan Roth
In the header file add:
afx_msg void OnFilterChanged(NMHDR* pNMHDR, LRESULT* pResult);
In the .cpp file add the following entries to the message map, but outside(!) of the special comments for the MFC ClassWizard:
BEGIN_MESSAGE_MAP(MyClass, SuperClass)
ON_NOTIFY(HDN_FILTERCHANGE, 0, OnFilterChanged)
END_MESSAGE_MAP()
The functions:
void MyClass::OnFilterChanged(NMHDR* pNMHDR, LRESULT* pResult)
// ..........
*pResult = 0;
void MyClass::OnFilterBtnClicked(NMHDR* pNMHDR, LRESULT* pResult)
// ........
*pResult = 0;
Just my two pence,
To overwrite the virtual method OnNotify() I do not hold for a particularly elegant solution.
The better way (IMHO) is to add ON_NOTIFY message handlers for HDN_FILTERCHANGE and/or HDN_FILTERBTNCLICK:
afx_msg void OnFilterBtnClicked(NMHDR* pNMHDR, LRESULT* pResult);
//{{AFX_MSG_MAP(MyClass)
// .....
//}}AFX_MSG_MAP
ON_NOTIFY(HDN_FILTERBTNCLICK, 0, OnFilterBtnClicked)
{
LPNMHEADER pNMHeader = reinterpret_cast<LPNMHEADER>(pNMHDR);
}
{
LPNMHDFILTERBTNCLICK pNMBClick =
reinterpret_cast<LPNMHDFILTERBTNCLICK>(pNMHDR);
}
Stephan Roth, Germany
Originally posted by: XingJun Zhang
Thanks Mr James for this free code program.But downloaded the program and cannot get it to compile: 26 errors.
1 - FBListCtrl.cpp(28) : error C2065: 'HDN_FILTERCHANGE' : undeclared identifier
2 - FBListCtrl.cpp(29) : error C2065: 'HDN_FILTERBTNCLICK' : undeclared identifier
etc...
I have downloaded the latesd SDK and installed it, also I have added the include and lib directory of SDK into the IDE of VC6.
Thanks!
Originally posted by: Keri
Has anybody discovered a way to allow the user to move b/w filter edits w/o using the mouse? I'd love to get the TAB key to do the trick...
ReplyOriginally posted by: Bill Roach
I have Version 5.81 of Comctl32.dll.
Suggestions.
Down loaded your source code and cannot get it to compile: 25 errors.
1 - FBListCtrl.cpp(28) : error C2065: 'HDN_FILTERCHANGE' : undeclared identifier
2 - FBListCtrl.cpp(29) : error C2065: 'HDN_FILTERBTNCLICK' : undeclared identifier
etc...
Originally posted by: Benjamin Mayrargue
There is a refresh problem when you double-click a column intersection in the column header in order to make it resize to its content.
The column extends to the width of its largest item.
But the filter button is not erased from its previous position.
This is in "comctl32.dll" ver 5.81.4134.600
(product ver 5.50.4134.600)
from IE 5.5 / NT4
___________________________
http://welcome.to/softbird
Originally posted by: James R. Twine
Please LMK exactly what version of Windows, IE, and MS Office is installed on your system. I am going to try to find time to find out why this thing is getting wonky on certain systems.
-=- James.
Reply