Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: REG_BINARY size problem? Pin
YaronNir17-Sep-05 1:21
YaronNir17-Sep-05 1:21 
GeneralRe: REG_BINARY size problem? Pin
Graham Bradshaw17-Sep-05 8:40
Graham Bradshaw17-Sep-05 8:40 
GeneralRe: REG_BINARY size problem? Pin
YaronNir17-Sep-05 19:57
YaronNir17-Sep-05 19:57 
AnswerRe: REG_BINARY size problem? Pin
kakan15-Sep-05 21:43
professionalkakan15-Sep-05 21:43 
GeneralRe: REG_BINARY size problem? Pin
YaronNir16-Sep-05 1:56
YaronNir16-Sep-05 1:56 
QuestionCrash on dev studio but works on command prompt Pin
valerie9915-Sep-05 10:32
valerie9915-Sep-05 10:32 
QuestionCHttpFile->WriteString Pin
aman200615-Sep-05 10:28
aman200615-Sep-05 10:28 
AnswerRe: CHttpFile->WriteString Pin
David Crow15-Sep-05 10:33
David Crow15-Sep-05 10:33 
GeneralRe: CHttpFile->WriteString Pin
aman200615-Sep-05 10:50
aman200615-Sep-05 10:50 
GeneralRe: CHttpFile->WriteString Pin
David Crow15-Sep-05 16:52
David Crow15-Sep-05 16:52 
Questionmicro control Pin
samira forooghi15-Sep-05 9:43
samira forooghi15-Sep-05 9:43 
AnswerRe: micro control Pin
Cedric Moonen15-Sep-05 20:44
Cedric Moonen15-Sep-05 20:44 
AnswerRe: micro control Pin
Eytukan15-Sep-05 23:58
Eytukan15-Sep-05 23:58 
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 

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.