本文整理汇总了C++中OLE2T函数的典型用法代码示例。如果您正苦于以下问题:C++ OLE2T函数的具体用法?C++ OLE2T怎么用?C++ OLE2T使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OLE2T函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: fReadInteger
/* ---------------------------- FILE IO ----------------------------------*/
STDMETHODIMP CFACE::fReadInteger( BSTR Category, BSTR KeyName, LONG Defaults , LONG *pVal){
USES_CONVERSION;
*pVal = GetPrivateProfileInt( OLE2T( Category ) , OLE2T( KeyName ) , Defaults , WritingPath );
return S_OK;
}
开发者ID:ginjih,项目名称:facelib,代码行数:8,代码来源:FACE_File.cpp
示例2: OLE2T
void CDlgIDirectoryObject::ShowAttributes()
{
ADS_OBJECT_INFO *pInfo;
HRESULT hr;
hr = m_pDirObject->GetObjectInformation(&pInfo);
if (!SUCCEEDED(hr) )
{
return;
}
/////////////////////////////////////////////
// Show the attributes in the UI
/////////////////////////////////////////////
USES_CONVERSION;
m_sRDN = OLE2T(pInfo->pszRDN);
m_sDN = OLE2T(pInfo->pszObjectDN);
m_sParent = OLE2T(pInfo->pszParentDN);
m_sClass = OLE2T(pInfo->pszClassName);
m_sSchema = OLE2T(pInfo->pszSchemaDN);
///////////////////////////////////////////////////////////
// Do not forget to clean-up the memory using FreeADsMem!
//////////////////////////////////////////////////////////
FreeADsMem( pInfo );
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:28,代码来源:DirectoryObject.cpp
示例3: _tcslen
const CCOMString& CCOMString::operator=(BSTR bstrStr)
{
USES_CONVERSION;
int nLen = _tcslen(OLE2T(bstrStr));
StringCopy(nLen, OLE2T(bstrStr));
return *this;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:7,代码来源:crt_cstring.cpp
示例4: while
void CDrawMenu::AddMenuItems(HMENU hMenu, int& nIndex, int nDepth)
{
USES_CONVERSION;
HTREEITEM hItem = NULL;
while (nIndex < m_arrItems.GetSize())
{
CMenuItem& item = m_arrItems[nIndex];
int nItemDepth = 0;
LPCWSTR p = item.m_bstrText;
while (*p++ == '.')
nItemDepth++;
if (nItemDepth < nDepth)
{
nIndex--;
break;
}
int nNextItemDepth = nItemDepth;
if (nIndex + 1 < m_arrItems.GetSize())
{
nNextItemDepth = 0;
CMenuItem& itemNext = m_arrItems[nIndex + 1];
LPCWSTR p = itemNext.m_bstrText;
while (*p++ == '.')
nNextItemDepth++;
}
if (nNextItemDepth > nItemDepth)
{
HMENU hNewMenu = CreatePopupMenu();
ATLASSERT(hNewMenu != NULL);
AddMenuItems(hNewMenu, ++nIndex, nDepth + 1);
AppendMenu(hMenu, MF_POPUP, (UINT)hNewMenu, OLE2T(item.m_bstrText + nItemDepth));
}
else
{
CComBSTR bstrItemText = item.m_bstrText + nItemDepth;
if (bstrItemText == L"-")
{
AppendMenu(hMenu, MF_SEPARATOR, 0, 0);
}
else
{
UINT uFlags = MF_STRING;
if ((item.m_dwState & MenuStateDisable) != 0)
uFlags |= MF_GRAYED;
if ((item.m_dwState & MenuStateCheck) != 0)
uFlags |= MF_CHECKED;
AppendMenu(hMenu, uFlags, nIndex + 1, OLE2T(bstrItemText));
}
}
nIndex++;
}
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:59,代码来源:DrawMenu.cpp
示例5: fWriteString
STDMETHODIMP CFACE::fWriteString( BSTR Category, BSTR KeyName, BSTR Data){
USES_CONVERSION;
if ( !WritePrivateProfileString( OLE2T( Category ), OLE2T( KeyName ) , OLE2T( Data ) , WritingPath ) )
LogPut( FATAL , IDS_ERR_INVALIDFILE );
return S_OK;
}
开发者ID:ginjih,项目名称:facelib,代码行数:8,代码来源:FACE_File.cpp
示例6: GetPrivateProfileString
STDMETHODIMP CFACE::fReadString( BSTR Category, BSTR KeyName, BSTR Default, BSTR lpBuffer ){
USES_CONVERSION;
GetPrivateProfileString( OLE2T( Category ) , OLE2T( KeyName ) , OLE2T( Default ) ,
OLE2T( lpBuffer ) , 256 , WritingPath );
return S_OK;
}
开发者ID:ginjih,项目名称:facelib,代码行数:8,代码来源:FACE_File.cpp
示例7: ZeroMemory
STDMETHODIMP CFACE::fWriteInteger( BSTR Category, BSTR KeyName, LONG Data){
USES_CONVERSION;
TCHAR DataString[ 256 ] ; ZeroMemory( DataString , sizeof(DataString) );
wsprintf( DataString , _T( "%l" ) , Data );
if ( !WritePrivateProfileString( OLE2T( Category ), OLE2T( KeyName ) , DataString , WritingPath ) )
LogPut( FATAL , IDS_ERR_INVALIDFILE );
return S_OK;
}
开发者ID:ginjih,项目名称:facelib,代码行数:11,代码来源:FACE_File.cpp
示例8: OLE2T
HRESULT __stdcall CoCOMServer::ahkdll(/*in,optional*/VARIANT filepath,/*in,optional*/VARIANT options,/*in,optional*/VARIANT params,/*out*/UINT_PTR* hThread)
{
USES_CONVERSION;
TCHAR buf1[MAX_INTEGER_SIZE],buf2[MAX_INTEGER_SIZE],buf3[MAX_INTEGER_SIZE];
if (hThread==NULL)
return ERROR_INVALID_PARAMETER;
*hThread = com_ahkdll(filepath.vt == VT_BSTR ? OLE2T(filepath.bstrVal) : Variant2T(filepath,buf1)
,options.vt == VT_BSTR ? OLE2T(options.bstrVal) : Variant2T(options,buf2)
,params.vt == VT_BSTR ? OLE2T(params.bstrVal) : Variant2T(params,buf3));
return S_OK;
}
开发者ID:Proximal,项目名称:SC2-MacroTrainer,代码行数:11,代码来源:dllmain.cpp
示例9: DoEvents
STDMETHODIMP CMktStructureBaseDlg::OnOption(PP::OptionParams *Params, PP::OptionInfo *Results, VARIANT_BOOL bLast)
{
USES_CONVERSION;
HRESULT hr = S_OK;
DoEvents();
if(m_bCanceled) return hr;
/*
if(bLast==VARIANT_FALSE && m_opts.m_enProviderType == enMyTrackPriceProvider)
{
if( fEQZero(Results->Last) && fEQZero(Results->Bid) && fEQZero(Results->Ask) )
return S_OK;
}
*/
if(bLast==VARIANT_FALSE && Results->ExpirationDate < int(vt_date::GetCurrentDate()))
return S_OK;
stocks_map::iterator it = m_stocks.find (Params->UnderlyingSymbol);
if (it != m_stocks.end())
try
{
USES_CONVERSION;
if (bLast)
{
it->second.m_bGotOptions = true;
UpdateProgress(it);
return hr;
}
CDBLayout db;
db.Connect();
db.UpdateOptionData (it->second.m_nID, Params, Results);
db.Disconnect();
CString strMsg;
strMsg.Format(IDS_MKTSTRUCTURE_GOTOPTION, OLE2T(Params->UnderlyingSymbol),
OLE2T(Results->Series) );
it->second.m_lGotOptions++;
StatusMessage (strMsg, false);
UpdateProgress(it);
}
catch (_com_error & e)
{
ErrorMessage(e);
Stop();
}
return hr;
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:54,代码来源:MktStructureBaseDlg.cpp
示例10: OLE2T
STDMETHODIMP CTangramOutLookPlusExplorer::put_UIScript(BSTR bstrKey, BSTR newVal)
{
CString strKey = OLE2T(bstrKey);
if (strKey != _T(""))
{
map<CString, CString>::iterator it = m_mapUIScript.find(strKey);
if (it != m_mapUIScript.end())
{
m_mapUIScript.erase(it);
}
m_mapUIScript[strKey] = OLE2T(newVal);
}
return S_OK;
}
开发者ID:jiazhy-zhiyuan,项目名称:TANGRAM,代码行数:14,代码来源:TangramOutLookAddin.cpp
示例11: LogBegin
STDMETHODIMP CFACE::Snd_Open( LONG BufferID , BSTR FileName ){
USES_CONVERSION;
// 開始
LogBegin( _T( "Snd_Open" ) );
//モードチェックと範囲チェック
CHECK_MODE( dwSndMode );
CHECK_RANGE_STR( BufferID , 0 , dwBufferNum , "Sound系関数(Snd_Open)->BufferID" );
/* スプライトへのアクセスポインタ -- */
BUFFERS *lpBuffer = &Buffers[ BufferID ];
lpBuffer->Clear( );
/* ファイルへのパスを取得する */
// ログアウト
LogPut( CONTINUE , IDS_LOG_LOADFROMFILE , OLE2T( FileName ) , BufferID );
TCHAR FilePath[ MAX_PATH ] , lpFormatStr[ 64 ];
if ( !GetFilePath( OLE2T( FileName ) , FilePath ) )
LogPut( FATAL , IDS_ERR_FILENOTFOUND );
lpBuffer->SndPts = fopen( FilePath , _T( "rb" ) );
// Check OGG Vorbis File?
if ( ogg_Open( lpBuffer ) != S_OK ){
// Check WAV File?
if ( wav_Open( lpBuffer ) != S_OK )
LogPut( FATAL , IDS_ERR_INVALIDFILE );
else
lstrcpy( lpFormatStr , _T( " ** WavFile **" ) );
}else
lstrcpy( lpFormatStr , _T(" ** OGGVorbisFile ** " ) );
// SoundBuffer構築構造体を初期化
lpBuffer->Make( BufferID == 0 );
/* Notify定義 */
if ( BufferID == 0 ){
SAFE_RELEASE( Notify );
// DirectSoundNotifyの作成
lpBuffer->SecBuf->QueryInterface( IID_IDirectSoundNotify ,(LPVOID*)&Notify );
DSBPOSITIONNOTIFY pn[3];
pn[0].dwOffset = lpBuffer->WaveFormat.nAvgBytesPerSec * BufferSec - 1;
pn[0].hEventNotify = hEvent[ 0 ];
pn[1].dwOffset = lpBuffer->WaveFormat.nAvgBytesPerSec * BufferSec / 2;
pn[1].hEventNotify = hEvent[ 1 ];
pn[2].dwOffset = DSBPN_OFFSETSTOP; // 再生停止
pn[2].hEventNotify = hEvent[ 2 ];
Notify->SetNotificationPositions( 3 , pn );
}
// ログアウト
LogPut( CONTINUE , IDS_LOG_SOUNDINFO , lpFormatStr );
LogQuit( );
return S_OK;
}
开发者ID:ginjih,项目名称:facelib,代码行数:50,代码来源:FACE_Sound.cpp
示例12: DumpIID
void DumpIID(REFIID iid, LPCTSTR pszClassName)
{
USES_CONVERSION;
CRegKey key;
TCHAR szName[100];
DWORD dwType;
DWORD dw = sizeof(szName);
LPOLESTR pszGUID = NULL;
if (FAILED(StringFromCLSID(iid, &pszGUID)))
return;
OutputDebugString(pszClassName);
OutputDebugString(_T(" - "));
bool bFound = false;
// Attempt to find it in the interfaces section
if (key.Open(HKEY_CLASSES_ROOT, _T("Interface"), KEY_READ) == ERROR_SUCCESS)
{
if (key.Open(key, OLE2T(pszGUID), KEY_READ) == ERROR_SUCCESS)
{
*szName = 0;
if (RegQueryValueEx(key.m_hKey, (LPTSTR)NULL, NULL, &dwType, (LPBYTE)szName, &dw) == ERROR_SUCCESS)
{
OutputDebugString(szName);
bFound = true;
}
}
}
// Attempt to find it in the clsid section
else if (key.Open(HKEY_CLASSES_ROOT, _T("CLSID"), KEY_READ) == ERROR_SUCCESS)
{
if (key.Open(key, OLE2T(pszGUID), KEY_READ) == ERROR_SUCCESS)
{
*szName = 0;
if (RegQueryValueEx(key.m_hKey, (LPTSTR)NULL, NULL, &dwType, (LPBYTE)szName, &dw) == ERROR_SUCCESS)
{
OutputDebugString(_T("(CLSID\?\?\?) "));
OutputDebugString(szName);
bFound = true;
}
}
}
if (!bFound)
OutputDebugString(OLE2T(pszGUID));
OutputDebugString(_T("\n"));
CoTaskMemFree(pszGUID);
}
开发者ID:techpub,项目名称:archive-code,代码行数:49,代码来源:IESecurity.cpp
示例13: getPouDir
STDMETHODIMP CLibObject::ExistsFile(
/*[in, string]*/BSTR sPOUName,
/*[in, string]*/BSTR sTargetType,
/*[in, string]*/BSTR sFileName,
/*[full][out] */DWORD* plFileByteSize
)
{
USES_CONVERSION;
HRESULT hr;
FC_ARSTAT ret;
FC_CArDir* pPOU;
FC_CArFile* pFile;
if(plFileByteSize)
*plFileByteSize = 0;
hr = getPouDir(sPOUName, sTargetType, &pPOU, NULL, false);
if(hr != S_OK)
return hr;
if((ret = pPOU->getFile(OLE2T(sFileName), &pFile)) != FC_AR_OK)
return onArError(ret, NULL);
if(!pFile)
return S_FALSE;
if(plFileByteSize)
{
*plFileByteSize = pFile->getSize();
assert(*plFileByteSize>=0);
}
return S_OK;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:33,代码来源:LowLevelLib.cpp
示例14: pSheet
void CTangramExcelPlusWB::OnSheetActivate(IDispatch* Sh)
{
CComQIPtr<Excel::_Worksheet> pSheet(Sh);
if(pSheet)
{
CComBSTR bstrName(L"");
pSheet->get_Name(&bstrName);
CString strName = OLE2T(bstrName);
CTangramXmlParse* pParse2 = GetChild(strName);
if(pParse2==NULL)
pParse2 = GetChild(_T("Default"));
if(pParse2)
{
HWND hWnd = ::GetActiveWindow();
HWND m_hClientWnd = ::FindWindowEx(hWnd,NULL,_T("XLDESK"),NULL);
HWND m_hWorkBookWnd = (HWND) ::SendMessage(m_hClientWnd,WM_MDIGETACTIVE,0,0);
CTangramExcelPlusWBWnd* pExcelWorkBookWnd = (CTangramExcelPlusWBWnd*)::SendMessage(m_hWorkBookWnd,WM_TANGRAMDATA,0,0);
pExcelWorkBookWnd->m_strActiveSheetName = strName;
CComPtr<ITangramNode> pNode;
pExcelWorkBookWnd->m_pWorkBook->m_pFrame->Extend(bstrName, CComBSTR(pParse2->xml()), &pNode);
// if(theApp.m_bOldVer)
// {
// if(pExcelWorkBookWnd&&pExcelWorkBookWnd->m_pWorkBook->m_pFrame)
// {
//pExcelWorkBookWnd->m_pWorkBook->m_pFrame->ModifyHost((LONGLONG)pExcelWorkBookWnd->m_pHeplerWnd->m_hWnd,(LONGLONG)pExcelWorkBookWnd->m_pHeplerWnd->m_pChild->m_hWnd);
// theApp.m_pTangramCore->NavigateXTML((LONGLONG)pExcelWorkBookWnd->m_pHeplerWnd->m_pChild->m_hWnd,CComBSTR(pParse2->xml()),&pNode);
//pExcelWorkBookWnd->m_pWorkBook->m_pFrame->ModifyHost((LONGLONG)hWnd,(LONGLONG)m_hClientWnd);
// }
// }
// else
// theApp.m_pTangramManager->NavigateXTML((LONGLONG)m_hClientWnd,CComBSTR(pParse2->xml()),&pNode);
}
}
}
开发者ID:tangramfx,项目名称:TANGRAM,代码行数:34,代码来源:ExcelPlusWnd.cpp
示例15: METHOD_PROLOGUE
STDMETHODIMP CShellExt::XPersistFileExt::Load(LPCOLESTR wszFile, DWORD dwMode)
{
METHOD_PROLOGUE(CShellExt, PersistFileExt);
USES_CONVERSION;
_tcscpy(pThis->m_szFile, OLE2T((WCHAR*)wszFile));
return S_OK;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:7,代码来源:shell_ext.cpp
示例16: ErrorDump
static void ErrorDump()
{
#if 0
USES_CONVERSION;
CDBErrorInfo einfo;
BSTR bstrDescription;
ULONG nRecords = 0;
HRESULT hr = einfo.GetErrorRecords(&nRecords);
if(SUCCEEDED(hr) && nRecords > 0)
{
LCID lcid = GetSystemDefaultLCID();
for(ULONG nIndex = 0; nIndex < nRecords; nIndex++)
{
hr = einfo.GetAllErrorInfo(nIndex, lcid, &bstrDescription);
if(SUCCEEDED(hr))
{
AfxMessageBox(OLE2T(bstrDescription));
SysFreeString(bstrDescription);
}
}
}
#endif
USES_CONVERSION;
CComPtr<IErrorInfo> pErrInfo;
HRESULT hr = ::GetErrorInfo(0, &pErrInfo);
if(SUCCEEDED(hr))
{
_bstr_t bstrErrDescription;
pErrInfo->GetDescription((BSTR *) &bstrErrDescription);
CString strDescription = W2T(bstrErrDescription);
OutputDebugString(strDescription);
}
}
开发者ID:usnistgov,项目名称:QIF,代码行数:35,代码来源:DBStepNC.cpp
示例17: AddTreeNode
STDMETHODIMP CTangramTreeView::AddTreeNode(long hItem, BSTR bstrXml)
{
if(m_pTangramHtmlTreeWnd)
{
CTangramXmlParse m_Parse;
if(m_Parse.LoadXml(OLE2T(bstrXml)))
{
int nCount = 0;
if((HTREEITEM)hItem)
{
HTREEITEM hChild = m_pTangramHtmlTreeWnd->GetChildItem((HTREEITEM)hItem);
CTangramXHtmlTreeNode *pXTCD = m_pTangramHtmlTreeWnd->GetItemDataStruct((HTREEITEM)hChild);
if(pXTCD->m_bWaitingFor)
m_pTangramHtmlTreeWnd->DeleteItem(hChild);
}
CTangramXHtmlTreeNode *pXTCD = m_pTangramHtmlTreeWnd->GetItemDataStruct((HTREEITEM)hItem);
if(pXTCD)
pXTCD->m_strTangramXML = _T("");
m_pTangramHtmlTreeWnd->LoadXml(&m_Parse,(HTREEITEM)hItem,nCount);
m_pTangramHtmlTreeWnd->Expand((HTREEITEM)hItem,TVE_EXPAND);
}
}
return S_OK;
}
开发者ID:SmallMrKong,项目名称:TANGRAM,代码行数:27,代码来源:TangramTreeView.cpp
示例18: FindVal
HRESULT CBasePropSetter::GetNumericVal(const TCHAR *szName, DWORD *pdwVal, int iBase = 10)
{
if ((iBase != 10) && (iBase != 16))
{
return E_INVALIDARG;
}
BSTR bstrVal;
HRESULT hr = FindVal(szName, &bstrVal);
if (SUCCEEDED(hr))
{
USES_CONVERSION;
TCHAR* tstr = OLE2T(bstrVal);
if (!tstr)
return E_FAIL;
#ifdef UNICODE
char strTmp[16];
wcstombs(strTmp, (const wchar_t *) tstr, sizeof(strTmp));
(*pdwVal) = strtol(strTmp, 0, iBase);
#else
(*pdwVal) = strtol(tstr, 0, iBase);
#endif
SysFreeString(bstrVal);
}
return hr;
}
开发者ID:chinajeffery,项目名称:dx_sdk,代码行数:31,代码来源:PropSetter.cpp
示例19: ATLTRACE
HRESULT CJSProxyObj::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
if (m_pJSExtender == nullptr)
{
ATLTRACE(_T("No TangramJSExtender pointer set\r\n"));
return S_OK;
}
HRESULT hr;
BSTR bstrMember = NULL;
CComBSTR bstrFunction = m_bstrPrefix;
bstrMember = m_mapDispId.Lookup(dispIdMember);
if (!bstrMember || SysStringLen(bstrMember) == 0)
{
ATLTRACE(_T("Tangram Could not find DISPID in lookup table\r\n"));
return S_OK;
}
if (m_pEventObj == nullptr)
bstrFunction += bstrMember;
DISPID dispIdEx;
hr = m_pJSExtender->m_pJSEngine->GetDispID(bstrFunction, fdexNameCaseSensitive, &dispIdEx);
if (FAILED(hr))
{
ATLTRACE(_T("Tangram Could not find matching function '%s' in Tangram\r\n"), OLE2T(bstrFunction));
return S_OK;
}
m_pJSExtender->m_pJSEngine->InvokeEx(dispIdEx, lcid, DISPATCH_METHOD, pDispParams, pVarResult, pExcepInfo, NULL);
return S_OK;
}
开发者ID:SmallMrKong,项目名称:TANGRAM,代码行数:32,代码来源:JSExtender.cpp
示例20:
CCOMString operator+(BSTR bstrStr, CCOMString& strSrc)
{
USES_CONVERSION;
CCOMString s;
s.ConcatCopy(OLE2T(bstrStr), (LPCTSTR) strSrc);
return s;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:7,代码来源:crt_cstring.cpp
注:本文中的OLE2T函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论