本文整理汇总了C++中CComBSTR::LoadString方法的典型用法代码示例。如果您正苦于以下问题:C++ CComBSTR::LoadString方法的具体用法?C++ CComBSTR::LoadString怎么用?C++ CComBSTR::LoadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComBSTR
的用法示例。
在下文中一共展示了CComBSTR::LoadString方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//////////////////////////////////////////////////////////////////////////////
// C[!output Safe_root]::GetPresetTitle
// Invoked when a host wants to obtain the title of the given preset
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP C[!output Safe_root]::GetPresetTitle(LONG nPreset, BSTR *bstrPresetTitle)
{
if (NULL == bstrPresetTitle)
{
return E_POINTER;
}
if ((nPreset < 0) || (nPreset >= PRESET_COUNT))
{
return E_INVALIDARG;
}
CComBSTR bstrTemp;
switch (nPreset)
{
case PRESET_BARS:
bstrTemp.LoadString(IDS_BARSPRESETNAME);
break;
case PRESET_SCOPE:
bstrTemp.LoadString(IDS_SCOPEPRESETNAME);
break;
}
if ((!bstrTemp) || (0 == bstrTemp.Length()))
{
return E_FAIL;
}
*bstrPresetTitle = bstrTemp.Detach();
return S_OK;
}
示例2: _DoNewFolder
/**
* Create the item as a new folder in the virtual file-system.
*/
HRESULT CNseBaseItem::_DoNewFolder(VFS_MENUCOMMAND& Cmd, UINT uLabelRes)
{
ATLASSERT(IsFolder());
// The new folder's label
CComBSTR bstrLabel;
bstrLabel.LoadString(uLabelRes);
// Create a new folder.
// TODO: Support FOF_RENAMEONCOLLISION flag.
CComPtr<IFileOperation> spFO;
HR( ::SHCreateFileOperation(Cmd.hWnd
, FOF_SILENT | FOF_NOCONFIRMATION | FOFX_NOSKIPJUNCTIONS
, &spFO) );
CComPtr<IShellItem> spTargetFolder;
HR( ::SHCreateItemFromIDList(m_pFolder->m_pidlMonitor, IID_PPV_ARGS(&spTargetFolder)) );
spFO->NewItem(spTargetFolder, FILE_ATTRIBUTE_DIRECTORY, bstrLabel, NULL, m_pFolder);
HR( spFO->PerformOperations() );
// HarryWu, 2014.2.6
// if do NOT go into edit mode, whatever.
// ----------------------------------
//// Go into edit-mode for new item
// HR( _AddSelectEdit(Cmd.punkSite, bstrLabel) );
// We handled this operation successfully for all items in selection
return NSE_S_ALL_DONE;
}
示例3: OnMenuSelect
LRESULT CShellViewImpl::OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
WORD wMenuID = LOWORD(wParam);
WORD wFlags = HIWORD(wParam);
// If the selected menu item is one of ours, show a flyby help string
// in the Explorer status bar.
if ( !(wFlags & MF_POPUP) )
{
switch ( wMenuID )
{
case IDC_EXPLORE_DRIVE:
case IDC_SYS_PROPERTIES:
case IDC_ABOUT_SIMPLENS:
{
CComBSTR bsHelpText;
if ( bsHelpText.LoadString ( wMenuID ))
{
m_spShellBrowser->SetStatusTextSB ( bsHelpText.m_str );
}
return 0;
}
break;
}
}
// Otherwise, pass the message to the default handler.
return DefWindowProc();
}
示例4: GetToolTip
STDMETHODIMP CExplorerCommand::GetToolTip(IShellItemArray* psiItemArray, LPWSTR* ppszInfotip)
{
CComBSTR bstrMenuText;
bstrMenuText.LoadString(m_mii.wID);
if( bstrMenuText.Length() == 0 ) return E_FAIL;
LPCWSTR pSep = wcschr(bstrMenuText, '\n');
if( pSep == NULL ) return E_FAIL;
return ::SHStrDupW(pSep + 1, ppszInfotip);
}
示例5: GetDisplayName
STDMETHODIMP CMapGeoPunktDLK::GetDisplayName(BSTR *pbstrDisplay)
{
CHECKINPOINTER(pbstrDisplay);
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYNAME_DLK));
*pbstrDisplay = S.Detach();
return S_OK;
}
示例6: GetAltFileFilter
STDMETHODIMP CMapGeoPunktDLK::GetAltFileFilter(BSTR* pbstrFilter)
{
CHECKINPOINTER(pbstrFilter);
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYFILTER_DLK));
*pbstrFilter = S.Detach();
return S_OK;
}
示例7: GetDescription
STDMETHODIMP CMapGeoPunktDLK::GetDescription(BSTR *prgFlags)
{
CHECKINPOINTER(prgFlags);
CComBSTR bstrDesc;
VERIFY(bstrDesc.LoadString(_Module.GetResourceInstance(), IDS_DESCRIPTION));
*prgFlags = bstrDesc.Detach();
return S_OK;
}
示例8: DllRegisterServer
STDAPI DllRegisterServer(void)
{
CComPtr<IWMPMediaPluginRegistrar> spRegistrar;
HRESULT hr;
// Create the registration object
hr = spRegistrar.CoCreateInstance(CLSID_WMPMediaPluginRegistrar, NULL, CLSCTX_INPROC_SERVER);
if ( FAILED( hr ) )
{
return hr;
}
// Load friendly name and description strings
CComBSTR bstrFriendlyName;
CComBSTR bstrDescription;
bstrFriendlyName.LoadString(IDS_FRIENDLYNAME);
bstrDescription.LoadString(IDS_DESCRIPTION);
// Describe the type of data handled by the plug-in
DMO_PARTIAL_MEDIATYPE mt = { 0 };
mt.type = MEDIATYPE_[!output SAFE_ROOT];
mt.subtype = MEDIASUBTYPE_NULL;
// Register the plug-in with WMP
hr = spRegistrar->WMPRegisterPlayerPlugin(
bstrFriendlyName, // friendly name (for menus, etc)
bstrDescription, // description (for Tools->Options->Plug-ins)
NULL, // path to app that uninstalls the plug-in
1, // DirectShow priority for this plug-in
WMP_PLUGINTYPE_RENDERING, // Plug-in type
CLSID_[!output Safe_root],// Class ID of plug-in
1, // No. media types supported by plug-in
&mt); // Array of media types supported by plug-in
if ( FAILED( hr ) )
{
return hr;
}
// registers object
return _Module.RegisterServer();
}
示例9: GetDisplayName
STDMETHODIMP CMapReferenced::GetDisplayName(/*[out]*/ BSTR* strDisplay) {
if(!strDisplay)
return E_POINTER;
// *strDisplay = ::SysAllocString( L"Rasterkarte mit Referenzinformationen\\Karte mit bekannten Eckpunkten" );
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYNAME_REF));
*strDisplay = S.Detach();
return S_OK;
}
示例10: bstrTitle
void
CContextSamplePropPage::MessageBox( UINT id )
{
CComBSTR bstrMessage;
CComBSTR bstrTitle( "Windows Media Services" );
if( bstrMessage.LoadString( id ) )
{
::MessageBox( m_hWnd, bstrMessage, bstrTitle, MB_OK );
}
}
示例11: GetApplicationName
//***************************************************************************
// GetApplicationName()
// Return the application name. It will be shown in player's menu View >
// Switch to applications
//***************************************************************************
HRESULT CRemoteHost::GetApplicationName(BSTR * pbstrName)
{
HRESULT hr = E_POINTER;
if(pbstrName)
{
CComBSTR bstrAppName = L"";
bstrAppName.LoadString(IDS_PROJNAME);
*pbstrName = bstrAppName.Detach();
hr = *pbstrName? S_OK : E_POINTER;
}
return hr;
}
示例12: GetLicensed
BOOL GetLicensed (void)
{
#if _TRiAS_VER < 0x0400
if (0 == g_dwVer4)
return TRUE;
#endif // _TRiAS_VER < 0x0400
VERIFYLICENSE VL;
CComBSTR bstrLicCap;
USES_CONVERSION;
bstrLicCap.LoadString(IDS_LONGCLASSNAME);
INITSTRUCT(VL, VERIFYLICENSE);
VL.iMode = VERIFYMODE_DontShowDialog|VERIFYMODE_LessOrEqual;
VL.lLevelOrOption = CKILEVEL_PLUS;
VL.pcCaption = OLE2A(bstrLicCap);
return DEX_VerifyLicenseLevel(VL);
}
示例13:
//////////////////////////////////////////////////////////////////////////////
// C[!output Safe_root]::GetTitle
// Invoked when a host wants to obtain the title of the effect
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP C[!output Safe_root]::GetTitle(BSTR* bstrTitle)
{
if (NULL == bstrTitle)
{
return E_POINTER;
}
CComBSTR bstrTemp;
bstrTemp.LoadString(IDS_EFFECTNAME);
if ((!bstrTemp) || (0 == bstrTemp.Length()))
{
return E_FAIL;
}
*bstrTitle = bstrTemp.Detach();
return S_OK;
}
示例14: GetCustomUIMode
//***************************************************************************
// GetCustomUIMode()
// When UI mode of the player OCX is set to custom, this function is called
// to give the skin file path that will be loaded to the player OCX.
//
//***************************************************************************
HRESULT CRemoteHost::GetCustomUIMode(BSTR * pbstrFile)
{
HRESULT hr = E_POINTER;
if (pbstrFile)
{
WCHAR wszCurDir[MAX_PATH];
CComBSTR bstrSkinPath = L"file://";
CComBSTR bstrSkinFilename;
GetCurrentDirectory(MAX_PATH, wszCurDir);
bstrSkinFilename.LoadString(IDS_SKINFILE);
bstrSkinPath.Append(wszCurDir);
bstrSkinPath.Append(L"\\");
bstrSkinPath.Append(bstrSkinFilename);
*pbstrFile = bstrSkinPath.Detach();
hr = *pbstrFile? S_OK : E_POINTER;
}
return hr;
}