MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / CompareFunction

Method CompareFunction

ReClass/DialogModulesBACKUP.cpp:180–208  ·  view source on GitHub ↗

int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);

Source from the content-addressed store, hash-verified

178
179//int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
180int CALLBACK CDialogModules::CompareFunction(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
181{
182 COMPARESTRUCT* compare = (COMPARESTRUCT*)lParamSort;
183 if (compare)
184 {
185 CListCtrl* pListCtrl = (CListCtrl*)compare->pListCtrl;
186 int column = compare->iColumn;
187
188 if (column == COLUMN_START || column == COLUMN_END || column == COLUMN_SIZE)
189 {
190 CString strNum1 = pListCtrl->GetItemText(static_cast<int>(lParam1), column);
191 CString strNum2 = pListCtrl->GetItemText(static_cast<int>(lParam2), column);
192
193 size_t num1 = (size_t)_tcstoui64(strNum1.GetBuffer(), NULL, 16);
194 size_t num2 = (size_t)_tcstoui64(strNum2.GetBuffer(), NULL, 16);
195
196 return num2 - num1;
197 }
198 else if (column == COLUMN_MODULE)
199 {
200 CString strModuleName1 = pListCtrl->GetItemText(static_cast<int>(lParam1), column);
201 CString strModuleName2 = pListCtrl->GetItemText(static_cast<int>(lParam2), column);
202
203 return _tcsicmp(strModuleName1.GetBuffer(), strModuleName2.GetBuffer());
204 }
205 }
206
207 return 0;
208}
209
210void CDialogModules::OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult)
211{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected