THIS IS SCRATCHY, but it works:
LRESULT MainFrame::onForce(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
int i = -1;
CString somes;
LVITEM lvi;
int nRes;
memset(&lvi, 0, sizeof(LVITEM));
lvi.iSubItem = COLUMN_STATUS;
while( (i = ctrlTransfers.GetNextItem(i, LVNI_SELECTED)) != -1) {
int nLen = 128;
do
{
nLen *= 2;
lvi.cchTextMax = nLen;
lvi.pszText = somes.GetBufferSetLength(nLen);
nRes = (int)::SendMessage(ctrlTransfers.m_hWnd, LVM_GETITEMTEXT, (WPARAM)i,
(LPARAM)&lvi);
} while (nRes == nLen - 1);
if(!strncmp(somes.GetString(), CSTRING(DOWNLOADED_LEFT), somes.FindOneOf(" "))||
!somes.Compare(CSTRING(DISCONNECTED))||!somes.Compare(CSTRING(CONNECTION_TIMEOUT))||
!somes.Compare(CSTRING(ALL_DOWNLOAD_SLOTS_TAKEN))||!somes.Compare(CSTRING(NO_SLOTS_AVAILABLE))) {
ItemInfo *validItemData = (ItemInfo*) ctrlTransfers.GetItemData(i);
if(validItemData){ //Try NULL? :)
ctrlTransfers.SetItemText(i, COLUMN_STATUS, CSTRING(CONNECTING_FORCED));
validItemData->user->connect();
} else break;
}
}
somes.ReleaseBuffer();
return 0;
}
SOLVED: Force attempt
Moderator: Moderators
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
I think I'm having a dense night (sorry). I can see that you're getting the text in the dialog and checking it against some of the strings before you try to force a connection, but I don't recall a previous mention of what behavior/side effects you're fixing by this patch.
Would it be possible to just read the state from the ConnectionQueueItem directly?
Would it be possible to just read the state from the ConnectionQueueItem directly?
-
- Posts: 2
- Joined: 2003-04-01 13:22
maybe, but it hasn't got too many stages.. I think there are only 2/3. (upload/download.. ?connecting?)
For now it is nice solve :o)
It's about a window with handleing transfers (that down). When you select all of that transfers, this will force only downloads.. Sometime it is good..
Srry 4 my EN :o)
For now it is nice solve :o)
It's about a window with handleing transfers (that down). When you select all of that transfers, this will force only downloads.. Sometime it is good..
Srry 4 my EN :o)
OKeeee?