Click here to Skip to main content
16,011,849 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Weird Memory Usage Pin
Tomasz Sowinski2-Oct-02 2:47
Tomasz Sowinski2-Oct-02 2:47 
GeneralCListCtrl and multiselect question Pin
ns2-Oct-02 1:25
ns2-Oct-02 1:25 
GeneralRe: CListCtrl and multiselect question Pin
Tomasz Sowinski2-Oct-02 1:33
Tomasz Sowinski2-Oct-02 1:33 
Generalan observation Pin
ns2-Oct-02 1:39
ns2-Oct-02 1:39 
Generalmore questions Pin
ns2-Oct-02 1:46
ns2-Oct-02 1:46 
GeneralRe: an observation Pin
Tomasz Sowinski2-Oct-02 1:49
Tomasz Sowinski2-Oct-02 1:49 
GeneralRe: an observation Pin
ns2-Oct-02 1:54
ns2-Oct-02 1:54 
Your response is very reassuring. Heres my code:

void CDlgLists::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	if (pNMListView->uOldState == 0 && pNMListView->uNewState == 0)
		return;	// No change







	BOOL bPrevState = (BOOL)(((pNMListView->uOldState & 
				LVIS_STATEIMAGEMASK)>>12)-1);   // Old check box state


	if (bPrevState < 0)	// On startup there's no previous state 
		bPrevState = 0; // so assign as false (unchecked)


	// New check box state
	BOOL bChecked=(BOOL)(((pNMListView->uNewState & LVIS_STATEIMAGEMASK)>>12)-1);



	if (bChecked < 0)
		bChecked = 0;



	BOOL bNameClicked = (bChecked < 0);



	if (bPrevState == bChecked) // No change in check box
		return;



	DWORD dwPos = ::GetMessagePos();

	CPoint point((int) LOWORD(dwPos), (int) HIWORD(dwPos));

	m_list2.ScreenToClient(&point);

	int nIndex;



	if ((nIndex = m_list2.HitTest(point)) == -1) return;


	OptStateMap &optStateMap = keyOptMap[activeKey];


	if (optStateMap.empty())
			GetOpts(activeKey,optStateMap);


	CString temp;
	temp.Format("index is %d ",nIndex);

	AfxMessageBox (temp);


	CString opt = m_list2.GetItemText(nIndex,0);


	keyOptMap[activeKey][opt] = !keyOptMap[activeKey][opt];
	
	*pResult = 0;
}


Do you think its the HitTest thats causing trouble and not letting it respond? My msgbox is beyond the hittest line (for testing).

So you can make the function run just by clicking the name? (or selecting a range of names, regardless of checkbox state)?


I thank you for your interest.


Appreciate your help,
ns
GeneralRe: an observation Pin
Tomasz Sowinski2-Oct-02 2:02
Tomasz Sowinski2-Oct-02 2:02 
Generalrequest Pin
ns2-Oct-02 2:06
ns2-Oct-02 2:06 
GeneralRe: request Pin
Tomasz Sowinski2-Oct-02 2:13
Tomasz Sowinski2-Oct-02 2:13 
Generalokay - doing that - final(?) question Pin
ns2-Oct-02 2:17
ns2-Oct-02 2:17 
GeneralRe: okay - doing that - final(?) question Pin
Tomasz Sowinski2-Oct-02 2:31
Tomasz Sowinski2-Oct-02 2:31 
GeneralRe: request Pin
ns2-Oct-02 2:44
ns2-Oct-02 2:44 
GeneralRe: request Pin
Tomasz Sowinski2-Oct-02 2:56
Tomasz Sowinski2-Oct-02 2:56 
GeneralDirectory name not recognized. Pin
WREY2-Oct-02 1:09
WREY2-Oct-02 1:09 
GeneralRe: Directory name not recognized. Pin
Tomasz Sowinski2-Oct-02 1:18
Tomasz Sowinski2-Oct-02 1:18 
GeneralRe: Directory name not recognized. Pin
Stephane Rodriguez.2-Oct-02 1:17
Stephane Rodriguez.2-Oct-02 1:17 
GeneralRe: Directory name not recognized. Pin
WREY2-Oct-02 2:42
WREY2-Oct-02 2:42 
GeneralCString -> Float / Int Pin
Daniel Strigl1-Oct-02 22:52
Daniel Strigl1-Oct-02 22:52 
GeneralRe: CString -> Float / Int Pin
Alexandru Savescu1-Oct-02 23:04
Alexandru Savescu1-Oct-02 23:04 
GeneralRefresh problem with CRecordset Pin
Christos P.1-Oct-02 22:16
Christos P.1-Oct-02 22:16 
GeneralRe: Refresh problem with CRecordset Pin
Steen Krogsgaard2-Oct-02 2:34
Steen Krogsgaard2-Oct-02 2:34 
GeneralRe: Refresh problem with CRecordset Pin
Tomasz Sowinski2-Oct-02 2:37
Tomasz Sowinski2-Oct-02 2:37 
GeneralRe: Refresh problem with CRecordset Pin
Steen Krogsgaard2-Oct-02 4:18
Steen Krogsgaard2-Oct-02 4:18 

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.