本文整理汇总了C++中CListBox::FindStringExact方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::FindStringExact方法的具体用法?C++ CListBox::FindStringExact怎么用?C++ CListBox::FindStringExact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::FindStringExact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msgarrvd
//.........这里部分代码省略.........
startupInfo.cb = sizeof(startupInfo);
strcpy(cmdline, tA2->ALERTME[i][4]);
if (strlen(cmdline) > 0) {
strcat(cmdline, " ");
strcat(cmdline, topicName);
strcat(cmdline, ",");
strcat(cmdline, pBuffer);
if (!CreateProcess(NULL, cmdline, NULL, NULL, false, 0, NULL, NULL, &startupInfo, &processInformation)) {
char * pErrMsg = (char *)malloc(500);
strcpy(pErrMsg, "Unknown application ");
strcat(pErrMsg, tA2->ALERTME[i][4]);
MessageBox(NULL, pErrMsg, "Alert Error", MB_OK);
free(pErrMsg);
}
}
}
}
i++;
}
}
CListCtrl *pListctrl = (CListCtrl *)tA->GetDlgItem(IDC_LIST3);
CButton *pButton1 = (CButton*) tA->GetDlgItem(IDC_CHECK4);
tA->SetDlgItemInt(IDC_EDIT14, ++tA2->iReceived,FALSE);
tA->SetDlgItemInt(IDC_EDIT18, tA2->iReceived - tA2->iReceivedRemoved, FALSE);
// Check maximum messages allowed in listbox
if (pButton1->GetCheck() == BST_CHECKED) {
int iMaxAllowed = tA->GetDlgItemInt(IDC_EDIT13,NULL,FALSE);
int iCurrentRows = pListctrl->GetItemCount();
while (iCurrentRows >= iMaxAllowed) {
// Delete oldest one
pListctrl->DeleteItem(iCurrentRows - 1);
tA2->iReceivedRemoved++;
iCurrentRows--;
}
tA->SetDlgItemInt(IDC_EDIT15, tA2->iReceivedRemoved,FALSE);
tA->SetDlgItemInt(IDC_EDIT18, tA2->iReceived - tA2->iReceivedRemoved,FALSE);
}
LVITEM lvi;
lvi.mask = LVIF_TEXT;
lvi.iItem = 0;
lvi.iSubItem = 0;
_itoa(iHash++, pHash, 10);
lvi.pszText = pHash;
pListctrl->InsertItem(&lvi);
lvi.iSubItem = 1;
time_t timer = time(NULL);
lvi.pszText = ctime(&timer);
pListctrl->SetItem(&lvi);
lvi.iSubItem = 2;
lvi.pszText = topicName;
pListctrl->SetItem(&lvi);
lvi.iSubItem = 3;
lvi.pszText = pBuffer;
pListctrl->SetItem(&lvi);
lvi.iSubItem = 4;
itoa(timer, pEnoch, 10);
lvi.pszText = pEnoch;
pListctrl->SetItem(&lvi);
pListctrl->SetColumnWidth(0, LVSCW_AUTOSIZE);
pListctrl->SetColumnWidth(1, LVSCW_AUTOSIZE);
pListctrl->SetColumnWidth(3, LVSCW_AUTOSIZE);
// Set Column width for topic
int iTW = pListctrl->GetStringWidth(topicName);
if (iTW > tA2->iTopicWidth && iTW < 400) {
tA2->iTopicWidth = iTW;
pListctrl->SetColumnWidth(2, iTW+15);
}
//Beep on receive if checkbox selected
pButton1 = (CButton*) tA->GetDlgItem(IDC_CHECK2);
if (pButton1->GetCheck() == BST_CHECKED) {
Beep(300, 200);
}
// See if topic is in subscriptions list
CListBox *pListbox = (CListBox *)tA->GetDlgItem(IDC_LIST1);
if (pListbox->FindStringExact(0, topicName) == LB_ERR) {
pListbox->InsertString(0, topicName);
tA->SetDlgItemText(IDC_EDIT11, "Consider saving setup");
}
free(pHash); free(pEnoch); free(pBuffer);
MQTTClient_freeMessage(&message);
MQTTClient_free(topicName);
return 1;
}