Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: lightweight replacement for std::vector? Pin
Chris Losinger13-Nov-02 5:15
professionalChris Losinger13-Nov-02 5:15 
AnswerRe: lightweight replacement for std::vector? Pin
Tim Smith13-Nov-02 6:20
Tim Smith13-Nov-02 6:20 
QuestionHow to chk dialog instance Pin
Prateeti12-Nov-02 19:48
Prateeti12-Nov-02 19:48 
Generalget 2 menus at same time Pin
includeh1012-Nov-02 18:11
includeh1012-Nov-02 18:11 
GeneralRe: get 2 menus at same time Pin
Maximilien13-Nov-02 3:12
Maximilien13-Nov-02 3:12 
GeneralSetting Color background in CClientDC Pin
WayneJ12-Nov-02 17:45
WayneJ12-Nov-02 17:45 
GeneralRe: Setting Color background in CClientDC Pin
dabs13-Nov-02 0:13
dabs13-Nov-02 0:13 
Generalsimple listctrl doubt Pin
fordge12-Nov-02 17:17
fordge12-Nov-02 17:17 
I think this is simple enough though the solution seems to be eluding me for almost a day now

i have a standard listctrl with checkbox ,say

m_list.SetExtendedStyle(LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT);

what i want is to lock some of the list rows,say row 2
so that the check box value cannot be modified by the user

so i wrote the following in NM_CLICK

{
// TODO: Add your control notification handler code here
NMITEMACTIVATE* pLVCD = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
LVITEM rItem;
int nItem = pLVCD->iItem;
ZeroMemory ( &rItem, sizeof(LVITEM) );
LVITEM rItem;
rItem.mask = LVIF_STATE;
rItem.iItem = nItem;
rItem.stateMask = LVIS_SELECTED|ODS_DISABLED;
m_list.GetItem ( &rItem );
if ( nItem ==2)
{
BOOL bSel=m_list.GetCheck(nItem);
m_list.SetItem(nItem,bSel);
m_list.Update(nItem);
}
*pResult = 0;
}

here if a checkbox is unselected and i click it
the control comes to the above code and bSel is FALSE and eventhough i say to update the list row 2 with that itself ...it doesnt work.

the rows check box gets selected invariable

i tried the same in LV_ITEMCHANGED and a couple of others as well...
but to no avail...

please put me out of my misery

what am i doing wrong??
GeneralRe: simple listctrl doubt Pin
Shog912-Nov-02 17:26
sitebuilderShog912-Nov-02 17:26 
GeneralCustomized Windows Pin
Shamoon12-Nov-02 16:35
Shamoon12-Nov-02 16:35 
GeneralRe: Customized Windows Pin
Christian Graus12-Nov-02 16:53
protectorChristian Graus12-Nov-02 16:53 
GeneralRe: Customized Windows Pin
Chris Maunder12-Nov-02 17:09
cofounderChris Maunder12-Nov-02 17:09 
QuestionHow to display standard shell properties for certain file? Pin
Alex Cramer12-Nov-02 16:31
Alex Cramer12-Nov-02 16:31 
AnswerRe: How to display standard shell properties for certain file? Pin
Chris Richardson12-Nov-02 17:46
Chris Richardson12-Nov-02 17:46 
GeneralDetermining Platform from WinCE DLL file Pin
Paul Wolfensberger12-Nov-02 15:58
Paul Wolfensberger12-Nov-02 15:58 
GeneralVC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
stevenson12-Nov-02 15:35
stevenson12-Nov-02 15:35 
GeneralRe: VC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
Christian Graus12-Nov-02 15:51
protectorChristian Graus12-Nov-02 15:51 
GeneralRe: VC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
stevenson12-Nov-02 20:40
stevenson12-Nov-02 20:40 
GeneralRe: VC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
Christian Graus12-Nov-02 20:46
protectorChristian Graus12-Nov-02 20:46 
GeneralRe: VC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
PJ Arends12-Nov-02 19:53
professionalPJ Arends12-Nov-02 19:53 
GeneralRe: VC coding Font!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
stevenson12-Nov-02 21:02
stevenson12-Nov-02 21:02 
QuestionHow to design the screen like XP "My Computer"? Pin
sages12-Nov-02 15:07
sages12-Nov-02 15:07 
QuestionHow to Get fields form DataGrid? Pin
YXF12-Nov-02 14:58
YXF12-Nov-02 14:58 
AnswerRe: How to Get fields form DataGrid? Pin
Mazdak12-Nov-02 20:02
Mazdak12-Nov-02 20:02 
Generalmfc dll Pin
peter ho12-Nov-02 14:45
peter ho12-Nov-02 14:45 

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.