Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionport parallel Pin
samira forooghi15-Sep-05 9:41
samira forooghi15-Sep-05 9:41 
AnswerRe: port parallel Pin
karmendra_js15-Sep-05 19:19
karmendra_js15-Sep-05 19:19 
QuestionDiving into GPS development Pin
ClockDivider15-Sep-05 9:19
ClockDivider15-Sep-05 9:19 
QuestionListView_SortItems question Pin
Tom Wright15-Sep-05 8:29
Tom Wright15-Sep-05 8:29 
NewsRe: ListView_SortItems question Pin
ClockDivider15-Sep-05 9:11
ClockDivider15-Sep-05 9:11 
GeneralRe: ListView_SortItems question Pin
Tom Wright15-Sep-05 10:06
Tom Wright15-Sep-05 10:06 
GeneralRe: ListView_SortItems question Pin
ClockDivider15-Sep-05 10:40
ClockDivider15-Sep-05 10:40 
GeneralRe: ListView_SortItems question Pin
Tom Wright15-Sep-05 11:30
Tom Wright15-Sep-05 11:30 
The problem with this is that I'm not using any MFC.

Here is my event code:
<br />
LPNMLISTVIEW lpNmlv = (LPNMLISTVIEW) lParam;<br />
<br />
			case LVN_COLUMNCLICK:<br />
				if (lpNmlv->hdr.hwndFrom == GetDlgItem(hWnd, IDC_LOCAL_FILELIST))<br />
				{<br />
					ListView_SortItems(lpNmlv->hdr.hwndFrom, ListViewCompareProc,(LPARAM)(lpNmlv));<br />
				}<br />
<br />
				if (lpNmlv->hdr.hwndFrom == GetDlgItem(hWnd, IDC_REMOTE_FILELIST))<br />
				{<br />
					HWND RemoteHwnd = GetDlgItem(hWnd, IDC_REMOTE_FILELIST);<br />
				}<br />
				return TRUE;<br />
<br />
<br />
int CALLBACK FileTransfer::ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)<br />
{<br />
	static LV_FINDINFO fi;<br />
	static int		 nItem1, nItem2;<br />
	static char		szBuf1[30], szBuf2[30];<br />
	NMLISTVIEW *lpNmlv = (NMLISTVIEW*)lParamSort;<br />
<br />
	// Determine the items that we are comparing.<br />
	//...........................................<br />
	fi.flags = LVFI_PARAM;<br />
	fi.lParam = lParam1;<br />
	<br />
	nItem1 = ListView_FindItem(lpNmlv->hdr.hwndFrom, -1, &fi);<br />
 <br />
	fi.lParam = lParam2;<br />
	nItem2 = ListView_FindItem(lpNmlv->hdr.hwndFrom, -1, &fi);<br />
	// Retrieve the item text so we can compare it.<br />
	//.............................................<br />
	ListView_GetItemText(lpNmlv->hdr.hwndFrom, nItem1, lParamSort, szBuf1, sizeof(szBuf1));<br />
	ListView_GetItemText(lpNmlv->hdr.hwndFrom, nItem2, lParamSort, szBuf2, sizeof(szBuf2));<br />
 <br />
	// Return the comparison results.<br />
	//...............................<br />
	if (lpNmlv) // ACENDING ORDER<br />
		return(strcmp(szBuf1, szBuf2));<br />
	else<br />
		return(strcmp(szBuf1, szBuf2) * -1);<br />
<br />
}<br />


Thanks


Tom Wright
tawright915@yahoo.com
GeneralRe: ListView_SortItems question Pin
ClockDivider15-Sep-05 12:14
ClockDivider15-Sep-05 12:14 
GeneralRe: ListView_SortItems question Pin
Tom Wright15-Sep-05 12:34
Tom Wright15-Sep-05 12:34 
QuestionRe: ListView_SortItems question Pin
ClockDivider15-Sep-05 13:49
ClockDivider15-Sep-05 13:49 
GeneralRe: ListView_SortItems question Pin
Graham Bradshaw15-Sep-05 13:43
Graham Bradshaw15-Sep-05 13:43 
GeneralRe: ListView_SortItems question Pin
David Crow15-Sep-05 16:55
David Crow15-Sep-05 16:55 
QuestionCopy a directory Pin
anderslundsgard15-Sep-05 8:12
anderslundsgard15-Sep-05 8:12 
AnswerRe: Copy a directory Pin
Ravi Bhavnani15-Sep-05 8:57
professionalRavi Bhavnani15-Sep-05 8:57 
AnswerRe: Copy a directory Pin
ThatsAlok15-Sep-05 17:51
ThatsAlok15-Sep-05 17:51 
QuestionAdding Date Time Picker to List Control Pin
ExtraLean15-Sep-05 8:08
ExtraLean15-Sep-05 8:08 
QuestionChange CRichEditCtrl CFE_LINK color Pin
cbusgut15-Sep-05 6:49
cbusgut15-Sep-05 6:49 
Questionc++ and canonical xml Pin
Imre Koszo15-Sep-05 5:59
Imre Koszo15-Sep-05 5:59 
AnswerRe: c++ and canonical xml Pin
David Crow15-Sep-05 6:29
David Crow15-Sep-05 6:29 
GeneralRe: c++ and canonical xml Pin
Imre Koszo15-Sep-05 22:31
Imre Koszo15-Sep-05 22:31 
GeneralRe: c++ and canonical xml Pin
David Crow16-Sep-05 2:01
David Crow16-Sep-05 2:01 
QuestionC++/Java Codes for RHPOP3Connect Pin
codedigger2215-Sep-05 4:55
codedigger2215-Sep-05 4:55 
Questionwhat about x = x++; ? Pin
pesho293215-Sep-05 4:55
pesho293215-Sep-05 4:55 
AnswerRe: what about x = x++; ? Pin
Chris Losinger15-Sep-05 5:35
professionalChris Losinger15-Sep-05 5:35 

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.