本文整理汇总了C++中CComBSTR::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ CComBSTR::Empty方法的具体用法?C++ CComBSTR::Empty怎么用?C++ CComBSTR::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComBSTR
的用法示例。
在下文中一共展示了CComBSTR::Empty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CComBSTR
void COFSNcDlg2::LoadColor(IXMLDOMNode *pColors, LPCTSTR szNodeName, CTL_COLOR &cr)
{
CComBSTR bs;
CComPtr<IXMLDOMNode> pColor = NULL;
if(pColors)
{
pColors->selectSingleNode(CComBSTR(szNodeName), &pColor);
if(pColor)
{
bs.Empty();
GetNodeAttribute(pColor, CComBSTR(L"bg"), bs);
if(bs.m_str != NULL)
swscanf(bs.m_str, L"0x%06x", &cr.crBG);
bs.Empty();
GetNodeAttribute(pColor, CComBSTR(L"fg"), bs);
if(bs.m_str != NULL)
swscanf(bs.m_str, L"0x%06x", &cr.crText);
bs.Empty();
GetNodeAttribute(pColor, CComBSTR(L"bgd"), bs);
if(bs.m_str != NULL)
swscanf(bs.m_str, L"0x%06x", &cr.crBGD);
bs.Empty();
GetNodeAttribute(pColor, CComBSTR(L"fgd"), bs);
if(bs.m_str != NULL)
swscanf(bs.m_str, L"0x%06x", &cr.crTextD);
}
}
}
示例2: CPropertyPage
CPPageFileInfoClip::CPPageFileInfoClip(CString fn, IFilterGraph* pFG)
: CPropertyPage(CPPageFileInfoClip::IDD, CPPageFileInfoClip::IDD)
, m_fn(fn)
, m_clip(ResStr(IDS_AG_NONE))
, m_author(ResStr(IDS_AG_NONE))
, m_copyright(ResStr(IDS_AG_NONE))
, m_rating(ResStr(IDS_AG_NONE))
, m_location_str(ResStr(IDS_AG_NONE))
, m_album(ResStr(IDS_AG_NONE))
, m_hIcon(NULL)
{
BeginEnumFilters(pFG, pEF, pBF) {
if (CComQIPtr<IPropertyBag> pPB = pBF) {
if (!((CMainFrame*)AfxGetMainWnd())->CheckMainFilter(pBF)) {
continue;
}
CComVariant var;
if (SUCCEEDED(pPB->Read(CComBSTR(_T("ALBUM")), &var, NULL))) {
m_album = var.bstrVal;
}
}
if (CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
if (!((CMainFrame*)AfxGetMainWnd())->CheckMainFilter(pBF)) {
continue;
}
CComBSTR bstr;
if (SUCCEEDED(pAMMC->get_Title(&bstr)) && bstr.Length()) {
m_clip = bstr.m_str;
bstr.Empty();
}
if (SUCCEEDED(pAMMC->get_AuthorName(&bstr)) && bstr.Length()) {
m_author = bstr.m_str;
bstr.Empty();
}
if (SUCCEEDED(pAMMC->get_Copyright(&bstr)) && bstr.Length()) {
m_copyright = bstr.m_str;
bstr.Empty();
}
if (SUCCEEDED(pAMMC->get_Rating(&bstr)) && bstr.Length()) {
m_rating = bstr.m_str;
bstr.Empty();
}
if (SUCCEEDED(pAMMC->get_Description(&bstr)) && bstr.Length()) {
m_descText = bstr.m_str;
m_descText.Replace(_T(";"), _T("\r\n"));
bstr.Empty();
}
}
}
EndEnumFilters;
}
示例3: CrackExtendProperty
HRESULT CTypeInfoBrowse::CrackExtendProperty(ICxEnumExtendProperty* pEnum, CPropInfoArray& arrProp)
{
LONG nIndex;
HRESULT hr;
CPropInfo prop;
pEnum->Reset();
while (S_FALSE != pEnum->Next(&nIndex))
{
hr = pEnum->GetType((LONG *)&prop.m_proptype);
if (FAILED(hr))
return hr;
CComBSTR bstr;
hr = pEnum->GetName(&bstr);
if (FAILED(hr))
return hr;
prop.m_bstrName = bstr;
bstr.Empty();
hr = pEnum->GetDescription(&bstr);
if (FAILED(hr))
return hr;
prop.m_bstrDesc = bstr;
hr = pEnum->GetDispid(&prop.m_dispid);
if (FAILED(hr))
return hr;
arrProp.Add(prop);
}
return S_OK;
}
示例4: get_AccountDispenser
HRESULT CPigEngine::get_AccountDispenser(IPigAccountDispenser** ppDispenser)
{
// Get the computer name of the account server
CComBSTR bstrServer;
RETURN_FAILED(get_AccountServer(&bstrServer));
if (!bstrServer.Length())
{
// Get the computer name of the mission server
RETURN_FAILED(get_MissionServer(&bstrServer));
}
// Check for '.' to indicate this computer
if (1 == bstrServer.Length() && OLESTR('.') == bstrServer[0])
bstrServer.Empty();
// Create the Pig Account Dispenser on the mission server
COSERVERINFO si = {0, bstrServer, NULL, 0};
MULTI_QI mqi = {&IID_IPigAccountDispenser, NULL, S_OK};
RETURN_FAILED(CoCreateInstanceEx(CLSID_PigAccountDispenser, NULL,
CLSCTX_SERVER, &si, 1, &mqi));
// Copy the interface pointer to the [out] parameter
ZSucceeded(mqi.hr);
*ppDispenser = (IPigAccountDispenser*)mqi.pItf;
// Indicate success
return S_OK;
}
示例5: Copy
HRESULT CAzRole::Copy(CAzRole &srcRole) {
CAzLogging::Entering(_TEXT("CAzRole::Copy"));
CComBSTR bstrData;
HRESULT hr=m_native->Submit(0,CComVariant());
CAzLogging::Log(hr,_TEXT("Submitting for role"),COLE2T(getName()));
if (FAILED(hr))
goto lError1;
hr=srcRole.m_native->get_Description(&bstrData);
CAzLogging::Log(hr,_TEXT("Getting Description for role"),COLE2T(getName()));
if (SUCCEEDED(hr)) {
hr=m_native->put_Description(bstrData);
CAzLogging::Log(hr,_TEXT("Setting Description for role"),COLE2T(getName()));
bstrData.Empty();
}
hr=srcRole.m_native->get_ApplicationData(&bstrData);
CAzLogging::Log(hr,_TEXT("Getting ApplicationData for role"),COLE2T(getName()));
if (SUCCEEDED(hr)) {
hr=m_native->put_ApplicationData(bstrData);
CAzLogging::Log(hr,_TEXT("Setting ApplicationData for role"),COLE2T(getName()));
}
hr=CopyUserData(srcRole);
CAzLogging::Log(hr,_TEXT("CopyUserData for role"),COLE2T(getName()));
hr=m_native->Submit(0,CComVariant());
CAzLogging::Log(hr,_TEXT("Submitting for role"),COLE2T(getName()));
lError1:
CAzLogging::Exiting(_TEXT("CAzRole::Copy"));
return hr;
}
示例6: get_Keys
STDMETHODIMP CAvatarProfileObject::get_Keys(IPropertyList** ppKeyList)
{
HRESULT hr = S_OK;
IAvatarProfileData* pProfileData = NULL;
CComBSTR curStr;
VARIANT_BOOL bDone;
CComVariant varVal;
long cKeys = 0;
if (ppKeyList == NULL)
return E_POINTER;
*ppKeyList = NULL;
if (m_pKeys == NULL)
{
VWTRACE(m_pWorld, "VWPROPERTY", VWT_ERROR, "CAvatarProfileObject::get_Keys: invalid key map\n");
hr = VWAVATARPROFILE_E_INVALIDKEYMAP;
goto ERROR_ENCOUNTERED;
}
hr = CreatePropertyList(m_pWorld, ppKeyList);
if (FAILED(hr) || (!*ppKeyList))
goto ERROR_ENCOUNTERED;
// map over the key list, collecting the names of valid keys
m_pKeys->FirstItem(&curStr.m_str, &varVal, &bDone);
while (bDone == VARIANT_FALSE)
{
hr = m_pKeys->get_ObjectProperty(curStr, (IObjectProperty **)&pProfileData);
if (SUCCEEDED(hr) && pProfileData)
{
if (IsKeyReadable(pProfileData))
(*ppKeyList)->AddString(curStr);
SAFERELEASE(pProfileData);
}
curStr.Empty();
varVal.Clear();
m_pKeys->NextItem(&curStr.m_str, &varVal, &bDone);
}
ERROR_ENCOUNTERED:
return hr;
}
示例7: LoadTargetData
/**
* load target data.
*
* uses LoadTargetOnlineData()
*
* @param [in] pITarget: interface pointer to KAD Target
* @return successful?
* @see LoadTargetOnlineData()
*/
BOOL CKADTargetInfo::LoadTargetData(CComPtr<ITarget>& pITarget)
{
HRESULT hr;
CComBSTR bstrTmp;
CString strType;
BOOL bReturn = TRUE;
WORD wTmp;
CKADTargetData* pTargetData;
hr = pITarget->GetTypeString(&bstrTmp);
strType = bstrTmp;
if(hr != S_OK)
{
bReturn = FALSE;
}
bstrTmp.Empty();
// create new target data object
pTargetData = new CKADTargetData;
hr = pITarget->GetFacilityCode(&wTmp);
if(hr == S_OK)
{
pTargetData->m_lFacilityCode = wTmp;
}
else
{
bReturn = FALSE;
}
hr = pITarget->GetExt(&bstrTmp);
ASSERT(hr == S_OK);
if(hr == S_OK)
{
pTargetData->m_strExtension = bstrTmp;
}
CComPtr<ITargetOnline> pITargetOnline;
hr = pITarget->GetTargetOnline(&pITargetOnline);
if(hr == S_OK && pITargetOnline)
{
if(!LoadTargetOnlineData(pITargetOnline, pTargetData))
{
bReturn = FALSE;
}
}
m_tTargetMap.SetAt(strType, pTargetData);
return bReturn;
}
示例8: SetDateTime
/****************************************
** Author: Joe Li
** Purpose: Set date and time string
** Comments:
****************************************/
void DOSaveAppData::SetDateTime()
{
if (m_dateTime.Length() != 0)
return;
STime localTime;
CComBSTR stringValue = _T("");
unsigned long value = 0;
DOTime::GetLocalTime(localTime);
value = localTime.year;
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
value = localTime.month;
if (value < APPEND_ZERO_CHECK_VALUE)
m_dateTime.Append(_T("0"));
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
value = localTime.day;
if (value < APPEND_ZERO_CHECK_VALUE)
m_dateTime.Append(_T("0"));
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
m_dateTime.Append(_T("_"));
value = localTime.hour;
if (value < APPEND_ZERO_CHECK_VALUE)
m_dateTime.Append(_T("0"));
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
value = localTime.minute;
if (value < APPEND_ZERO_CHECK_VALUE)
m_dateTime.Append(_T("0"));
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
value = localTime.second;
if (value < APPEND_ZERO_CHECK_VALUE)
m_dateTime.Append(_T("0"));
DODataConversion::LongToString(value, stringValue);
m_dateTime.Append(stringValue);
stringValue.Empty();
m_dateTime.Append(_T("_"));
}
示例9: Copy
HRESULT CAzOperation::Copy(CAzOperation &srcOp) {
CAzLogging::Entering(_TEXT("Copy"));
CComBSTR data;
LONG lopID;
HRESULT hr;
hr=srcOp.m_native->get_ApplicationData(&data);
CAzLogging::Log(hr,_TEXT("Getting Application Data for Operation"),COLE2T(getName()));
hr=m_native->put_ApplicationData(data);
CAzLogging::Log(hr,_TEXT("Setting Application Data for Operation"),COLE2T(getName()));
data.Empty();
hr=srcOp.m_native->get_OperationID(&lopID);
CAzLogging::Log(hr,_TEXT("Getting OperationID for Operation"),COLE2T(getName()));
hr=m_native->put_OperationID(lopID);
CAzLogging::Log(hr,_TEXT("Setting Operation ID for Operation"),COLE2T(getName()));
hr=srcOp.m_native->get_Description(&data);
CAzLogging::Log(hr,_TEXT("Getting Description for Operation"),COLE2T(getName()));
hr=m_native->put_Description(data);
CAzLogging::Log(hr,_TEXT("Setting Description for Operation"),COLE2T(getName()));
hr=m_native->Submit(0,CComVariant());
CAzLogging::Log(hr,_TEXT("Submitting changes for Operation"),COLE2T(getName()));
CAzLogging::Exiting(_TEXT("Copy"));
return hr;
}
示例10: OnOK
void CNumericEntryDlg::OnOK()
{
USES_CONVERSION;
m_strScript += _T("\r\n");
CComBSTR bstr;
m_editMin.GetWindowText((BSTR&)bstr);
CComVariant var = bstr;
if (var.ChangeType(VT_R4) != S_OK)
{
MessageBox(_T("输入合法的数据!"));
m_editMin.SetFocus();
m_editMin.SetSel(0, -1);
return;
}
m_strScript += _T(" DataEntry.min = ");
m_strScript += OLE2T(bstr);
m_strScript += _T("\r\n");
bstr.Empty();
m_editMax.GetWindowText((BSTR&)bstr);
var = bstr;
if (var.ChangeType(VT_R4) != S_OK)
{
MessageBox(_T("请输入合法的数据!"));
m_editMax.SetFocus();
m_editMax.SetSel(0, -1);
return;
}
m_strScript += _T(" DataEntry.max = ");
m_strScript += OLE2T(bstr);
m_strScript += _T("\r\n");
if (m_btnFetchLimit.GetCheck() == 1)
m_strScript += _T(" DataEntry.fetch = true");
else
m_strScript += _T(" DataEntry.fetch = false");
}
示例11: BuildClientInfoXml
CComBSTR CIbnCommandWnd::BuildClientInfoXml()
{
CComBSTR bstrCommandXML;
bstrCommandXML += L"<clientInfo><response><login></login><firstName></firstName><lastName></lastName><email></email><status></status></response></clientInfo>";
CComPtr<IXMLDOMDocument> xmlResponseDoc = NULL;
xmlResponseDoc.CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER);
VARIANT_BOOL varSuc = VARIANT_FALSE;
xmlResponseDoc->loadXML(bstrCommandXML,&varSuc);
CComPtr<IXMLDOMNode> xmlLoginNode;
CComPtr<IXMLDOMNode> xmlFirstNameNode;
CComPtr<IXMLDOMNode> xmlLastNameNode;
CComPtr<IXMLDOMNode> xmlEmailNode;
CComPtr<IXMLDOMNode> xmlStatusNode;
xmlResponseDoc->selectSingleNode(CComBSTR(L"clientInfo/response/login"),&xmlLoginNode);
xmlResponseDoc->selectSingleNode(CComBSTR(L"clientInfo/response/firstName"),&xmlFirstNameNode);
xmlResponseDoc->selectSingleNode(CComBSTR(L"clientInfo/response/lastName"),&xmlLastNameNode);
xmlResponseDoc->selectSingleNode(CComBSTR(L"clientInfo/response/email"),&xmlEmailNode);
xmlResponseDoc->selectSingleNode(CComBSTR(L"clientInfo/response/status"),&xmlStatusNode);
xmlLoginNode->put_text(CComBSTR((LPCTSTR)pMessenger->GetCurrentUser().m_strLogin));
xmlFirstNameNode->put_text(CComBSTR((LPCTSTR)pMessenger->GetCurrentUser().m_strFirstName));
xmlLastNameNode->put_text(CComBSTR((LPCTSTR)pMessenger->GetCurrentUser().m_strLastName));
xmlEmailNode->put_text(CComBSTR((LPCTSTR)pMessenger->GetCurrentUser().m_strEMail));
WCHAR Buff[20] = L"";
_ltow(pMessenger->GetCurrentUser().m_iStatus,Buff,10);
xmlStatusNode->put_text(CComBSTR(Buff));
bstrCommandXML.Empty();
xmlResponseDoc->get_xml(&bstrCommandXML);
return bstrCommandXML;
}
示例12: Copy
HRESULT CAzAppGroup::Copy(CAzAppGroup &srcAppGroup) {
CAzLogging::Entering(_TEXT("Copy"));
CComBSTR bstrData;
CComVariant cVVar;
LONG lType;
HRESULT hr=srcAppGroup.m_native->get_Description(&bstrData);
CAzLogging::Log(hr,_TEXT("Getting Description for App Group"),COLE2T(srcAppGroup.getName()));
if (SUCCEEDED(hr)) {
hr=m_native->put_Description(bstrData);
CAzLogging::Log(hr,_TEXT("Setting Description for App Group"),COLE2T(getName()));
bstrData.Empty();
}
hr=srcAppGroup.m_native->get_Type(&lType);
CAzLogging::Log(hr,_TEXT("Getting Type for App Group"),COLE2T(srcAppGroup.getName()));
if (SUCCEEDED(hr)) {
hr=m_native->put_Type(lType);
CAzLogging::Log(hr,_TEXT("Setting Type for App Group"),COLE2T(getName()));
}
hr=srcAppGroup.m_native->get_LdapQuery(&bstrData);
CAzLogging::Log(hr,_TEXT("Getting LDAPQuery for App Group"),COLE2T(srcAppGroup.getName()));
// THe length check is reqd below as adding an empty string
// LDAP Query returns an error
if (SUCCEEDED(hr) && bstrData.Length()!=0) {
hr=m_native->put_LdapQuery(bstrData);
CAzLogging::Log(hr,_TEXT("Setting LDAPQuery for App Group"),COLE2T(getName()));
bstrData.Empty();
}
if (CAzGlobalOptions::m_bVersionTwo) {
hr = CopyVersion2Constructs(srcAppGroup);
CAzLogging::Log(hr,_TEXT("Copying bizrule properties for App Group"),COLE2T(srcAppGroup.getName()));
}
if (!CAzGlobalOptions::m_bIgnoreMembers) {
hr=srcAppGroup.m_native->get_Members(&cVVar);
CAzLogging::Log(hr,_TEXT("Getting Members for App Group"),COLE2T(srcAppGroup.getName()));
if (SUCCEEDED(hr)) {
hr=InitializeUsingSafeArray(cVVar,&IAzApplicationGroup::AddMember);
CAzLogging::Log(hr,_TEXT("Setting Members for App Group"),COLE2T(getName()));
cVVar.Clear();
}
hr=srcAppGroup.m_native->get_NonMembers(&cVVar);
CAzLogging::Log(hr,_TEXT("Getting Non Members for App Group"),COLE2T(srcAppGroup.getName()));
if (SUCCEEDED(hr)) {
hr=InitializeUsingSafeArray(cVVar,&IAzApplicationGroup::AddNonMember );
CAzLogging::Log(hr,_TEXT("Setting Non Members for App Group"),COLE2T(getName()));
cVVar.Clear();
}
}
hr=m_native->Submit(0,CComVariant());
CAzLogging::Log(hr,_TEXT("Submitting App Group"),COLE2T(getName()));
CAzLogging::Exiting(_TEXT("Copy"));
return hr;
}
示例13: newRule
STDMETHODIMP
CContentBasedClassifier::UseRulesAndDefinitions(
IFsrmCollection * Rules,
IFsrmCollection * propertyDefinitions
)
{
HRESULT hr = S_OK;
_variant_t vRule;
CComPtr<IFsrmRule> pFsrmRule;
CComPtr<IFsrmClassificationRule> pFsrmClassificationRule;
CComBSTR strRuleName;
wstring strRuleNameLower;
CComBSTR strPropertyName;
CComBSTR strPropertyValue;
LONG cRuleCount;
SAFEARRAY *psaParams = NULL;
SAFEARRAY *psaParsedParams = NULL;
SAFEARRAYBOUND rgsaBound[1];
LONG paramIndex;
LONG lBoundParams;
LONG uBoundParams;
GUID idRule;
m_mapFsrmClassificationRules.clear();
hr = Rules->get_Count( &cRuleCount );
if (hr != S_OK) {
goto exit;
}
//iterate over the rules collection and build a map to store
//this map will be used while processing records for matching rules
for (LONG iRule = 1; iRule <= cRuleCount; iRule++) {
vRule.Clear( );
// Get the next rule
hr = Rules->get_Item( iRule, &vRule );
if (hr != S_OK) {
goto exit;
}
// Query for the IFsrmRule interface
pFsrmRule.Release( );
hr = vRule.pdispVal->QueryInterface( _uuidof( IFsrmRule ), (void **)&pFsrmRule );
if (hr != S_OK) {
goto exit;
}
// Query for the IFsrmClassificationRule interface
pFsrmClassificationRule.Release( );
hr = pFsrmRule->QueryInterface( _uuidof( IFsrmClassificationRule ), (void **)&pFsrmClassificationRule );
if (hr != S_OK) {
goto exit;
}
// Get the rule's name
strRuleName.Empty( );
hr = pFsrmRule->get_Name( &strRuleName );
if (hr != S_OK) {
goto exit;
}
// Get the property name for this rule
strPropertyName.Empty( );
hr = pFsrmClassificationRule->get_PropertyAffected( &strPropertyName );
if (hr != S_OK) {
goto exit;
}
// Get the property value that will be applied by this rule
strPropertyValue.Empty( );
hr = pFsrmClassificationRule->get_Value( &strPropertyValue );
if (hr != S_OK) {
goto exit;
}
// Get the additional classification parameters for this rule
psaParams = NULL;
hr = pFsrmRule->get_Parameters(&psaParams);
if (FAILED(hr))
{
goto exit;
}
// Get the rule id guid
::memset(&idRule, 0, sizeof(GUID));
hr = pFsrmRule->get_Id(&idRule);
if (FAILED(hr))
{
goto exit;
}
psaParsedParams = NULL;
if (psaParams)
{
// The additional parameters array contains parameters in the following format
// key=value
//.........这里部分代码省略.........
示例14: CPropertyPage
CPPageFileInfoClip::CPPageFileInfoClip(CString path, IFilterGraph* pFG, IFileSourceFilter* pFSF, IDvdInfo2* pDVDI)
: CPropertyPage(CPPageFileInfoClip::IDD, CPPageFileInfoClip::IDD)
, m_hIcon(nullptr)
, m_fn(path)
, m_path(path)
, m_clip(ResStr(IDS_AG_NONE))
, m_author(ResStr(IDS_AG_NONE))
, m_copyright(ResStr(IDS_AG_NONE))
, m_rating(ResStr(IDS_AG_NONE))
, m_location(ResStr(IDS_AG_NONE))
{
if (pFSF) {
LPOLESTR pFN;
if (SUCCEEDED(pFSF->GetCurFile(&pFN, nullptr))) {
m_fn = pFN;
CoTaskMemFree(pFN);
}
} else if (pDVDI) {
ULONG len = 0;
if (SUCCEEDED(pDVDI->GetDVDDirectory(m_path.GetBufferSetLength(MAX_PATH), MAX_PATH, &len)) && len) {
m_path.ReleaseBuffer();
m_fn = m_path += _T("\\VIDEO_TS.IFO");
}
}
bool bFound = false;
BeginEnumFilters(pFG, pEF, pBF) {
if (CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF) {
CComBSTR bstr;
if (SUCCEEDED(pAMMC->get_Title(&bstr)) && bstr.Length()) {
m_clip = bstr.m_str;
bFound = true;
}
bstr.Empty();
if (SUCCEEDED(pAMMC->get_AuthorName(&bstr)) && bstr.Length()) {
m_author = bstr.m_str;
bFound = true;
}
bstr.Empty();
if (SUCCEEDED(pAMMC->get_Copyright(&bstr)) && bstr.Length()) {
m_copyright = bstr.m_str;
bFound = true;
}
bstr.Empty();
if (SUCCEEDED(pAMMC->get_Rating(&bstr)) && bstr.Length()) {
m_rating = bstr.m_str;
bFound = true;
}
bstr.Empty();
if (SUCCEEDED(pAMMC->get_Description(&bstr)) && bstr.Length()) {
m_desc = bstr.m_str;
bFound = true;
}
bstr.Empty();
if (bFound) {
break;
}
}
}
EndEnumFilters;
}
示例15: LoadFromRegistry
void CPagePlayers::LoadFromRegistry()
{
// Open/create the registry key
CRegKey key;
key.Create(HKEY_LOCAL_MACHINE, HKLM_AllSrvUI);
// PlayerListColumnOrder
CComBSTR bstrColumnOrder;
LoadRegString(key, TEXT("PlayerListColumnOrder"), bstrColumnOrder);
m_spStrings->RemoveAll();
m_spStrings->AddDelimited(CComBSTR(L","), bstrColumnOrder);
long cOrderedColumns = 0;
m_spStrings->get_Count(&cOrderedColumns);
if (c_cColumns == cOrderedColumns)
{
int vecOrder[c_cColumns];
for (CComVariant i(0L); V_I4(&i) < c_cColumns; ++V_I4(&i))
{
bstrColumnOrder.Empty();
m_spStrings->get_Item(&i, &bstrColumnOrder);
vecOrder[V_I4(&i)] = _wtoi(bstrColumnOrder);
}
m_listPlayers.SetColumnOrderArray(c_cColumns, vecOrder);
}
// PlayerListColumnWidths
CComBSTR bstrColumnWidths;
LoadRegString(key, TEXT("PlayerListColumnWidths"), bstrColumnWidths);
m_spStrings->RemoveAll();
m_spStrings->AddDelimited(CComBSTR(L","), bstrColumnWidths);
long cWidthColumns = 0;
m_spStrings->get_Count(&cWidthColumns);
if (c_cColumns == cWidthColumns)
{
for (CComVariant i(0L); V_I4(&i) < c_cColumns; ++V_I4(&i))
{
bstrColumnWidths.Empty();
m_spStrings->get_Item(&i, &bstrColumnWidths);
m_listPlayers.SetColumnWidth(V_I4(&i), _wtoi(bstrColumnWidths));
}
}
else
{
for (int i = 0; i < c_cColumns; ++i)
{
TCHAR szColumn[_MAX_PATH];
LVCOLUMN lvc = {LVCF_TEXT, 0, 0, szColumn, sizeofArray(szColumn)};
m_listPlayers.GetColumn(i, &lvc);
int cx = m_listPlayers.GetStringWidth(CString(szColumn) + TEXT(" "));
m_listPlayers.SetColumnWidth(i, cx);
}
}
// SendChatMRU
m_comboSendChat.ResetContent();
CRegKey keyMRU;
if (ERROR_SUCCESS == keyMRU.Create(key, TEXT("SendChatMRU")))
{
// Read the count of strings
DWORD cStrings = 0;
// mdvalley: Former QueryDWORDValue(cStr, TEXT);
keyMRU.QueryValue(cStrings, TEXT(".Count"));
// Read each string and add it to the combo box
for (DWORD i = 0; i < cStrings; ++i)
{
TCHAR szInt[16];
CString strMRUItem;
LoadRegString(keyMRU, _itot(i, szInt, 10), strMRUItem);
strMRUItem.TrimLeft();
strMRUItem.TrimRight();
if (!strMRUItem.IsEmpty())
m_comboSendChat.InsertString(i, strMRUItem);
}
}
}