本文整理汇总了C++中CComboBox::GetLBTextLen方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::GetLBTextLen方法的具体用法?C++ CComboBox::GetLBTextLen怎么用?C++ CComboBox::GetLBTextLen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::GetLBTextLen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFindText
int FindReplDlg::GetFindText(CComboBox& wnd, bsString& text)
{
int len;
char *tp;
int sel = wnd.GetCurSel();
if (sel == -1)
{
len = wnd.GetWindowTextLength()+1;
tp = new char[len];
wnd.GetWindowText(tp, len);
sel = wnd.FindStringExact(-1, tp);
if (sel == -1)
{
sel = wnd.InsertString(0, tp);
wnd.SetCurSel(sel);
}
int cnt;
while ((cnt = wnd.GetCount()) >= 20)
wnd.DeleteString(cnt-1);
}
else
{
len = wnd.GetLBTextLen(sel)+1;
tp = new char[len];
wnd.GetLBText(sel, tp);
}
text.Attach(tp);
return sel;
}
示例2: OnButtonSelectprioritytagOk
void CPriorityTag::OnButtonSelectprioritytagOk()
{
// TODO: Add your control notification handler code here
GAL_ERROR hError;
ptrArm_UI_Update_Priority->priority_tag = m_cbPriorityTag.GetItemData(m_cbPriorityTag.GetCurSel());
if ((proc_obj_arm_ui_update_priority(m_lpAccountData->GetHandle(),ptrArm_UI_Update_Priority, &hError)) == GAL_SUCCESS) {
CComboBox *pmyPriorityItemComboBox = (CComboBox *)GetDlgItem(IDC_COMBO_SELECTPRIORITYTAG_PRIORITYTAG_VALUE);
for (int i=0;i < pmyPriorityItemComboBox->GetCount();i++) {
if ((int)(pmyPriorityItemComboBox->GetItemData(i)) == ptrArm_UI_Update_Priority->priority_tag) {
CString combotext;
int n = pmyPriorityItemComboBox->GetLBTextLen( i );
pmyPriorityItemComboBox->GetLBText( i, combotext.GetBuffer(n) );
strcpy(cellvalue,combotext);
combotext.ReleaseBuffer();
}
}
}
CDialog::OnOK();
}
示例3: OnCamSetupButton
void CVisualPage::OnCamSetupButton()
{
CComboBox * box = (CComboBox*)(GetDlgItem(IDC_RECORDING_COMBO));
int i = box->GetCurSel();
int n = box->GetLBTextLen(i);
CString s;
box->GetLBText(i, s.GetBuffer(n));
PString setupDeviceName = s;
s.ReleaseBuffer();
if (setupDeviceName.IsEmpty()) return;
if (setupDeviceName.Find("fake") == 0) return;
if (setupDeviceName.Find("monitor") == 0) return;
if (setupDeviceName.Find("zmonitor") == 0) return;
PTRACE(4,"PVidDirectShow\tCurrent device: " << setupDeviceName);
HRESULT hr;
IBaseFilter * pFilter = NULL;
IMoniker *pMoniker =NULL;
ICreateDevEnum *pDevEnum =NULL;
IEnumMoniker *pClassEnum = NULL;
ULONG cFetched;
::CoInitialize(NULL);
// Create the system device enumerator
hr = CoCreateInstance (CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC, IID_ICreateDevEnum, (void **) &pDevEnum);
if (FAILED(hr)) { ::CoUninitialize(); return; }
// Create an enumerator for the video capture devices
hr = pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pClassEnum, 0);
if (FAILED(hr)) { ::CoUninitialize(); return; }
if (pClassEnum == NULL) { ::CoUninitialize(); return; }
PTRACE(4,"PVidDirectShow\tEntering device enumeration loop...");
while (1)
{ // Get the next device
hr = pClassEnum->Next(1, &pMoniker, &cFetched);
if (hr != S_OK) { PTRACE(4, "PVidDirectShow\tGetInputDeviceNames() No more video capture device"); break; }
// Get the property bag
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)(&pPropBag));
if (FAILED(hr))
{ PTRACE(4,"PVidDerectShow\tBindToStorage failed, continue");
pMoniker->Release();
continue;
}
// Find the description or friendly name.
VARIANT DeviceName;
DeviceName.vt = VT_BSTR;
hr = pPropBag->Read(L"Description", &DeviceName, NULL);
if (FAILED(hr)) hr = pPropBag->Read(L"FriendlyName", &DeviceName, NULL);
if (SUCCEEDED(hr))
{ char *pDeviceName = BSTR_to_ANSI(DeviceName.bstrVal);
if (pDeviceName)
{ PTRACE(4, "PVidDirectShow\tGetInputDeviceNames() Found this capture device '"<< pDeviceName <<"'");
if(PString(pDeviceName) == setupDeviceName)
{
PTRACE(4, "PVidDirectShow\tCamera Setup: device found");
pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**) &pFilter);
ISpecifyPropertyPages *p_spec; CAUUID cauuid;
HRESULT hr = pFilter->QueryInterface( IID_ISpecifyPropertyPages, (void **)&p_spec );
if( !FAILED(hr) )
if( SUCCEEDED(p_spec->GetPages( &cauuid )) )
{ if( cauuid.cElems > 0 )
{ HWND hwnd_desktop = ::GetDesktopWindow();
OleCreatePropertyFrame( hwnd_desktop, 30, 30, NULL, 1, (LPUNKNOWN *)(&pFilter), cauuid.cElems, cauuid.pElems, 0, 0, NULL );
CoTaskMemFree( cauuid.pElems );
}
p_spec->Release();
}
}
free(pDeviceName);
}
}
pPropBag->Release();
pMoniker->Release();
}
::CoUninitialize();
}