本文整理汇总了C++中DataFieldEnum::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFieldEnum::Clear方法的具体用法?C++ DataFieldEnum::Clear怎么用?C++ DataFieldEnum::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataFieldEnum
的用法示例。
在下文中一共展示了DataFieldEnum::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSend
void OnSend(WndButton* pWnd) {
if(ItemIndex < FileList.size()) {
StartHourglassCursor();
//Start Bluetooth if needed...
#ifdef UNDER_CE
CObexPush Obex;
if(Obex.Startup()) {
StartupStore(_T("Startup OK \n"));
size_t nDevice = Obex.LookupDevice();
StartupStore(_T("LookupDevice OK \n"));
if(nDevice == 0) {
StopHourglassCursor();
MessageBoxX(_T("No Device"), _T("Error"), mbOk);
StartHourglassCursor();
} else {
WndProperty* wp = (WndProperty*)wfDlg->FindByName(TEXT("prpDeviceList"));
DataFieldEnum* dfe = NULL;
if (wp) {
dfe = (DataFieldEnum*)wp->GetDataField();
}
if(dfe) {
dfe->Clear();
dfe->addEnumText(_T("none"));
}
for(size_t i = 0; i < nDevice; ++i) {
TCHAR szDeviceName[100] = {0};
if(!Obex.GetDeviceName(i, szDeviceName, array_size(szDeviceName))) {
_stprintf(szDeviceName, _T("Unknown device <%d>"), i);
}
StartupStore(_T("GetDeviceName <%d><%s> \n"), i, szDeviceName);
if(dfe) {
dfe->addEnumText(szDeviceName);
}
}
if(wp) {
if(dfe) {
dfe->SetAsInteger(0);
}
wp->SetReadOnly(false);
wp->RefreshDisplay();
}
StopHourglassCursor();
size_t DeviceIndex = 0;
if(dfe && wp) {
dlgComboPicker(wp);
DeviceIndex = dfe->GetAsInteger();
}
StartHourglassCursor();
if(DeviceIndex != 0) {
DeviceIndex--;
TCHAR szFileFullPath[MAX_PATH] = _T("\0");
LocalPath(szFileFullPath, _T(LKD_LOGS));
size_t nLen = _tcslen(szFileFullPath);
if (szFileFullPath[nLen - 1] != _T('\\')) {
_tcscat(szFileFullPath, _T("\\"));
}
FileList_t::const_iterator ItFileName = FileList.begin();
std::advance(ItFileName, ItemIndex);
_tcscat(szFileFullPath, ItFileName->c_str());
if(!Obex.SendFile(DeviceIndex, szFileFullPath)) {
StopHourglassCursor();
MessageBoxX(_T("Send Failed"), _T("Error"), mbOk);
StartHourglassCursor();
} else {
StopHourglassCursor();
MessageBoxX(_T("File sent!"), _T("Success"), mbOk);
StartHourglassCursor();
}
}
}
Obex.Shutdown();
} else {
MessageBoxX(_T("Unsupported on this device"), _T("Error"), mbOk);
}
#else
MessageBoxX(_T("Unsupported on this device"), _T("Error"), mbOk);
#endif
StopHourglassCursor();
}
}