您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ATLVERIFY函数代码示例

51自学网 2021-06-01 19:38:32
  C++
这篇教程C++ ATLVERIFY函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ATLVERIFY函数的典型用法代码示例。如果您正苦于以下问题:C++ ATLVERIFY函数的具体用法?C++ ATLVERIFY怎么用?C++ ATLVERIFY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ATLVERIFY函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SetClipboardText

void SetClipboardText(const std::wstring& text){	if (!::OpenClipboard(::GetDesktopWindow()))		return;	ATLVERIFY(::EmptyClipboard());	const size_t length = (text.size() + 1) * sizeof(text[0]);	HANDLE hmem = ::GlobalAlloc(GMEM_MOVEABLE, length);	UIETWASSERT(hmem); // We are not hardened against OOM.	void* const ptr = ::GlobalLock(hmem);	UIETWASSERT(ptr != NULL);	wcscpy_s(static_cast<wchar_t*>(ptr), (text.size() + 1), text.c_str());	UnlockGlobalMemory(hmem);	if (::SetClipboardData(CF_UNICODETEXT, hmem) == NULL)	{		ATLVERIFY(!::GlobalFree(hmem));		ATLVERIFY(::CloseClipboard());		return;	}	ATLVERIFY(::CloseClipboard());}
开发者ID:fdoray,项目名称:UIforETW,代码行数:25,


示例2: ATLVERIFY

STDMETHODIMP CNdasUnitImpl::GetRaidSimpleStatus (	NDAS_LOGICALUNIT_DEFINITION *NdasLogicalUnitDefinition,	UINT8						*NdasUnitNo,	DWORD						*RaidSimpleStatusFlags	){	HRESULT hr;	HNDAS   ndasHandle;	ATLVERIFY( RaidSimpleStatusFlags != NULL );	hr = ConnectUnitDevice(&ndasHandle);	if (FAILED(hr)) {		return hr;	}	hr = NdasVsmGetRaidSimpleStatus( ndasHandle, NdasLogicalUnitDefinition, NdasUnitNo, RaidSimpleStatusFlags );	if (FAILED(hr)) {		ATLVERIFY(S_OK == DisonnectUnitDevice(ndasHandle));		return hr;	}	ATLVERIFY(S_OK == DisonnectUnitDevice(ndasHandle));	return S_OK;}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:31,


示例3: ATLASSERT

DWORD CNdasDevicePropGeneralPage::pUpdateThreadStart(DWORD UnitIndex){	ATLASSERT(UnitIndex < RTL_NUMBER_OF(m_pUnitDevices));	if (UnitIndex >= RTL_NUMBER_OF(m_pUnitDevices))	{		ATLVERIFY(PostMessage(			WM_THREADED_WORK_COMPLETED, 0, static_cast<LPARAM>(UnitIndex)));		return 255;	}	ndas::UnitDevicePtr pUnitDevice = m_pUnitDevices[UnitIndex];	if (!pUnitDevice)	{		ATLVERIFY(PostMessage(			WM_THREADED_WORK_COMPLETED, 0, static_cast<LPARAM>(UnitIndex)));		return 1;	}	(void) pUnitDevice->UpdateHostStats();	ATLVERIFY(PostMessage(		WM_THREADED_WORK_COMPLETED, 0, static_cast<LPARAM>(UnitIndex)));	return 0;}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:25,


示例4: helper

HRESULT CCurrencyConversionSamplePlugin::StartDisplayingItems() {  CComQIPtr<IGoogleDesktopDisplayPluginHelper> helper(m_pluginHelper);  if (m_pluginHelper == NULL)    return E_FAIL;  // set flags  GoogleDesktopDisplayPluginFlags plugin_flags = GDD_PLUGIN_FLAG_NONE;  GoogleDesktopDisplayContentFlags content_flags = GDD_CONTENT_FLAG_NONE;  ATLVERIFY(SUCCEEDED(helper->SetFlags(plugin_flags, content_flags)));  // set about text  CComBSTR about_text;  about_text.LoadString(IDS_COPYRIGHT);  ATLVERIFY(SUCCEEDED(helper->put_about_text(about_text)));  // set icons  CComPtr<IPicture> title_icon, about_icon;  ATLVERIFY(SUCCEEDED(::LoadPictureFromResource(ghInstance,    MAKEINTRESOURCE(IDR_GIF_CURRENCY_ICON_SMALL), L"GIF",    &title_icon)));  ATLVERIFY(SUCCEEDED(::LoadPictureFromResource(ghInstance,    MAKEINTRESOURCE(IDR_GIF_CURRENCY_ICON_LARGE), L"GIF",    &about_icon)));  ATLVERIFY(SUCCEEDED(helper->SetIcons(title_icon, about_icon)));  UpdateTitle(false);  // display the first set of items  SetContentLayout();  ChangeItems(NULL);  return S_OK;}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:32,


示例5: ATLASSERT

CNBNdasDevice::CNBNdasDevice(PNDASUSER_DEVICE_ENUM_ENTRY pBaseInfo, NDAS_DEVICE_STATUS status){	ATLASSERT(pBaseInfo);	CopyMemory(&m_BaseInfo, pBaseInfo, sizeof(NDASUSER_DEVICE_ENUM_ENTRY));	m_status = status;	ATLVERIFY(SUCCEEDED( StringCchCopy(		m_NdasId.Id, RTL_NUMBER_OF(m_NdasId.Id), pBaseInfo->szDeviceStringId) ));	if (pBaseInfo->GrantedAccess & GENERIC_WRITE)	{		// We uses the magic write key in case write access is granted.		ATLVERIFY(SUCCEEDED( StringCchCopy(			m_NdasId.Key, RTL_NUMBER_OF(m_NdasId.Key), _T("*****")) ));	}	ZeroMemory(&m_DeviceId, sizeof(NDAS_DEVICE_ID));	NdasIdStringToDeviceEx(pBaseInfo->szDeviceStringId, &m_DeviceId, NULL, &m_IdExtData);	m_DeviceId.VID = m_IdExtData.VID;		#if 0	NDASUSER_DEVICE_INFORMATION ndasDeviceInfo;	ATLVERIFY( NdasQueryDeviceInformation(pBaseInfo->SlotNo, &ndasDeviceInfo) );	m_DeviceId = ndasDeviceInfo.HardwareInfo.NdasDeviceId;#endif	if (m_DeviceId.VID == 0) {		ATLTRACE(_T("Assume VID is 1 if VID=0/n"));		m_DeviceId.VID = 1;	}	ATLTRACE(_T("new CNBNdasDevice(%p) : Name %s, ID %s, Slot %d, Access %08x/n"),		this, pBaseInfo->szDeviceName, pBaseInfo->szDeviceStringId, pBaseInfo->SlotNo, pBaseInfo->GrantedAccess);}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:35,


示例6: ATLVERIFY

HRESULT CExeModule::LoadExchangeCodes(){	ATLVERIFY(SUCCEEDED(_LoadExchangeCodes(STOCKEXCHANGECODES_SETTINGS, m_StockExchangeCodes)));	ATLVERIFY(SUCCEEDED(_LoadExchangeCodes(OPTIONEXCHANGECODES_SETTINGS, m_OptionExchangeCodes)));	return S_OK;}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:7,


示例7: GetLastError

DWORDCDismountDialog::WorkItemStart(){	m_EjectError = 0;	BOOL success = m_pLogDevice->Eject(&m_EjectParam);	if (!success)	{		m_EjectError = GetLastError();		ATLTRACE("Eject failed, error=0x%X/n", m_EjectError);	}	else	{		if (m_EjectParam.ConfigRet != CR_SUCCESS)		{			ATLTRACE("Eject failed from configuration manager, configRet=%d/n",				m_EjectParam.ConfigRet);			ATLTRACE("VetoType=%d,VetoName=%ls/n",				m_EjectParam.VetoType,				m_EjectParam.VetoName);		}	}	ATLVERIFY( PostMessage(WM_WORKITEM_COMPLETED) );	ATLVERIFY( SetEvent(m_WorkItemFinished) );	return 0;}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:29,


示例8: switch

BOOL CPnpEventConsumerWindow::OnDeviceChange(	UINT EventType, PDEV_BROADCAST_HANDLE Dbch){	switch (EventType)	{	case DBT_DEVICEREMOVECOMPLETE:		{			ATLVERIFY( m_DevNotifyHandles.Remove(Dbch->dbch_hdevnotify) );			printf("Unregistering DevNotifyHandle=%p/n", Dbch->dbch_hdevnotify);			ATLVERIFY( UnregisterDeviceNotification(Dbch->dbch_hdevnotify) );		}		break;	case DBT_CUSTOMEVENT:		if (IsEqualGUID(Dbch->dbch_eventguid, GUID_NDASPORT_PNP_NOTIFICATION))		{			PNDASPORT_PNP_NOTIFICATION ndasportNotification = 				reinterpret_cast<PNDASPORT_PNP_NOTIFICATION>(Dbch->dbch_data);			OnNdasPortEvent(ndasportNotification);		}		else if (IsEqualGUID(Dbch->dbch_eventguid, GUID_NDAS_ATA_LINK_EVENT))		{			PNDAS_ATA_LINK_EVENT ndasAtaLinkEvent =				reinterpret_cast<PNDAS_ATA_LINK_EVENT>(Dbch->dbch_data);			OnNdasAtaLinkEvent(ndasAtaLinkEvent);		}		else if (IsEqualGUID(Dbch->dbch_eventguid, NDAS_DLU_EVENT_GUID))		{			PNDAS_DLU_EVENT ndasDluEvent =				reinterpret_cast<PNDAS_DLU_EVENT>(Dbch->dbch_data);			OnNdasDluEvent(ndasDluEvent);		}		else if (IsEqualGUID(Dbch->dbch_eventguid, GUID_IO_VOLUME_MOUNT))		{			// printf("Volume is mounted, handle=%p/n", Dbch->dbch_handle);		}		else		{			OLECHAR guidString[64] = {0};			StringFromGUID2(				Dbch->dbch_eventguid,				guidString,				64);			if (-1 != Dbch->dbch_nameoffset)			{				printf("Unknown %s (%ls)",					((PUCHAR)Dbch) + Dbch->dbch_nameoffset,					guidString);			}			else			{				printf("Unknown %ls", guidString);			}		}	}	return TRUE;}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:59,


示例9: SetRegistryDWORD

void SetRegistryDWORD(const HKEY root, const std::wstring& subkey, const std::wstring& valueName, const DWORD value){	HKEY key;	if (::RegOpenKeyExW(root, subkey.c_str(), 0, KEY_ALL_ACCESS, &key) != ERROR_SUCCESS)		return;	ATLVERIFY(ERROR_SUCCESS == ::RegSetValueExW(key, valueName.c_str(), 0, REG_DWORD, reinterpret_cast<const BYTE*>(&value), sizeof(value)));	ATLVERIFY(::RegCloseKey(key) == ERROR_SUCCESS);}
开发者ID:fdoray,项目名称:UIforETW,代码行数:8,


示例10: ATLTRACE

void CMainFrame::OnNdasServiceConnectFailed(){	ATLTRACE("Connection to the NDAS Service failed./n");	ATLVERIFY(m_taskbarIcon.ChangeIcon(_CreateTaskbarIcon(false)));	ATLVERIFY( m_taskbarIcon.SetToolTipText(IDR_TASKBAR_FAIL) );}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:8,


示例11: PostMessage

LRESULT CMiniPieFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/){	CAppInfo info;	// Full screen mode delayed restoration 	bool bFull = false;	info.Restore(bFull, L"Full");	if (bFull)		PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);	CreateSimpleCEMenuBar();#ifdef WIN32_PLATFORM_WFSP // SmartPhone	AtlActivateBackKey(m_hWndCECommandBar);#endif 	UIAddToolBar(m_hWndCECommandBar);	SetCommandButton(ID_APP_EXIT);	// StatusBar state restoration 	bool bVisible = true;	info.Restore(bVisible, L"Status");	DWORD dwStyle = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_TOP;	if (bVisible)		dwStyle |= WS_VISIBLE;	// StatusBar creation 	CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, dwStyle);	UIAddStatusBar(m_hWndStatusBar);	UISetCheck(ID_VIEW_STATUS_BAR, bVisible);	// Browser view creation	m_hWndClient = m_browser.Create(m_hWnd, NULL, _T("Microsoft.PIEDocView"),                     WS_CHILD | WS_VISIBLE | WS_BORDER, 0, ID_BROWSER);    ATLVERIFY(SUCCEEDED(m_browser.QueryControl(&m_spIWebBrowser2)));    ATLVERIFY(SUCCEEDED(AtlAdviseSinkMap(this, true)));	// Navigation menu initialization	UIEnable(IDM_BACK, FALSE);	UIEnable(IDM_FORWARD, FALSE);	UIEnable(IDM_STOP, FALSE);	UIEnable(IDM_REFRESH, FALSE);#ifdef WIN32_PLATFORM_PSPC 	// PPC Address bar state restoration    VARIANT_BOOL vb = ATL_VARIANT_TRUE;	info.Restore(vb, L"Address");	m_spIWebBrowser2->put_AddressBar(vb);	UISetCheck(ID_VIEW_ADDRESSBAR, vb == ATL_VARIANT_TRUE);#endif 	// register object for message filtering and idle updates	CMessageLoop* pLoop = _Module.GetMessageLoop();	ATLASSERT(pLoop != NULL);	pLoop->AddMessageFilter(this);	pLoop->AddIdleHandler(this);	return 0;}
开发者ID:Bizonu,项目名称:amclibrary,代码行数:58,


示例12: RegisterWithGDEventFramework

HRESULT RegisterWithGDEventFramework() {  CComPtr<IGoogleDesktopRegistrar> registrar;  HRESULT hr = registrar.CoCreateInstance(L"GoogleDesktop.Registrar");  if (SUCCEEDED(hr)) {    CComBSTR our_guid(CONSOLE_PLUGIN_GUID);    WCHAR icon_path[_MAX_PATH + 1] = {0};    ATLVERIFY(::GetModuleFileNameW(NULL, icon_path, _MAX_PATH - 2) != 0);    SafeStrCat(icon_path, L"@0", _MAX_PATH+1);    CComSafeArray<VARIANT> description;    ATLVERIFY(SUCCEEDED(description.Create(8)));    VARIANT* props = reinterpret_cast<VARIANT*>(description.m_psa->pvData);    for (DWORD i = 0; i < description.GetCount(); ++i) {      props[i].vt = VT_BSTR;    }    props[0].bstrVal = ::SysAllocString(L"Title");    props[1].bstrVal = ::SysAllocString(L"Console Events");    props[2].bstrVal = ::SysAllocString(L"Description");    props[3].bstrVal = ::SysAllocString(L"Outputs events from Google Desktop to the console");    props[4].bstrVal = ::SysAllocString(L"Icon");    props[5].bstrVal = ::SysAllocString(icon_path);    props[6].bstrVal = ::SysAllocString(L"Homepage");    props[7].bstrVal = ::SysAllocString(L"http://desktop.google.com");    VARIANT desc;    desc.vt = VT_ARRAY | VT_VARIANT;    desc.parray = description;    hr = registrar->StartComponentRegistration(our_guid, desc);    if (SUCCEEDED(hr)) {      CComPtr<IUnknown> unknown;      hr = registrar->GetRegistrationInterface(CComBSTR(L"GoogleDesktop.EventRegistration"),                                               &unknown);      ATLASSERT(SUCCEEDED(hr));      CComQIPtr<IGoogleDesktopRegisterEventPlugin> event_registration(unknown);      if (event_registration != NULL) {        long cookie = 0;        hr = event_registration->RegisterPlugin(our_guid, &cookie);        if (SUCCEEDED(hr)) {          hr = registrar->FinishComponentRegistration();          if (SUCCEEDED(hr)) {            hr = StoreRegistrationCookie(cookie);          }        }      }    }  }  return hr;}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:57,


示例13: ATLTRACE

voidCNdasDevicePropGeneralPage::OnReset(){	ATLTRACE(__FUNCTION__ "/n");	ATLVERIFY(AtlWaitWithMessageLoop(m_ThreadCompleted));	ATLVERIFY(m_imageList.Destroy());	ATLVERIFY(DestroyAcceleratorTable(m_hAccel));}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:10,


示例14: GetDlgItemInt

STDMETHODIMP SysMonPluginPropPage::Apply(void) {  int refresh_interval = GetDlgItemInt(IDC_EDIT_REFRESH_INTERVAL, NULL, 0);  int max_disk_rw = GetDlgItemInt(IDC_EDIT_MAX_DISK_RW, NULL, 0);  int max_net_io = GetDlgItemInt(IDC_EDIT_MAX_NET_IO, NULL, 0);  int active_monitors = 0;  int auto_adjust_chart_max = 1;  if (!refresh_interval) {    refresh_interval = 1;   // Minimum 1 seconds  }  if (!max_disk_rw) {    max_disk_rw = 50000;  }  if (!max_net_io) {    max_net_io = 50000;  }  if (::SendMessage(GetDlgItem(IDC_CHECK_CPU),                               BM_GETCHECK, 0, 0) == BST_CHECKED) {    active_monitors |= ACTIVE_MON_CPU;  }  if (::SendMessage(GetDlgItem(IDC_CHECK_MEM),                               BM_GETCHECK, 0, 0) == BST_CHECKED) {    active_monitors |= ACTIVE_MON_MEM;  }  if (::SendMessage(GetDlgItem(IDC_CHECK_DISK),                               BM_GETCHECK, 0, 0) == BST_CHECKED) {    active_monitors |= ACTIVE_MON_DISK;  }  if (::SendMessage(GetDlgItem(IDC_CHECK_NET),                               BM_GETCHECK, 0, 0) == BST_CHECKED) {    active_monitors |= ACTIVE_MON_NET;  }  auto_adjust_chart_max = (::SendMessage(GetDlgItem(IDC_CHECK_AUTO_MAX),    BM_GETCHECK, 0, 0) == BST_CHECKED);  for (int i = 0; i < static_cast<int>(m_nObjects); ++i) {    CComQIPtr<IGoogleDesktopSysMonPlugin> plugin(m_ppUnk[i]);    if (plugin) {      ATLVERIFY(SUCCEEDED(plugin->put_refresh_interval(refresh_interval)));      ATLVERIFY(SUCCEEDED(plugin->put_active_monitors(active_monitors)));      ATLVERIFY(SUCCEEDED(plugin->put_max_disk_rw_in_chart(max_disk_rw)));      ATLVERIFY(SUCCEEDED(plugin->put_max_net_io_in_chart(max_net_io)));      ATLVERIFY(SUCCEEDED(plugin->put_auto_adjust_chart_max(        auto_adjust_chart_max)));    }  }  m_bDirty = FALSE;  return S_OK;}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:51,


示例15: ATLVERIFY

void CMainFrame::pChangeTaskBarIcon(bool Normal){	if (Normal) {		ATLVERIFY( m_taskbarIcon.ChangeIcon(pCreateTaskbarIcon(true)) );		ATLVERIFY( m_taskbarIcon.SetToolTipText(IDR_TASKBAR) );		} else {		ATLVERIFY( m_taskbarIcon.ChangeIcon(pCreateTaskbarIcon(false)) );		ATLVERIFY( m_taskbarIcon.SetToolTipText(IDR_TASKBAR_FAIL) );	}}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:14,


示例16: ATLTRACE

voidCMainFrame::pImportRegistration(LPCTSTR szFileName){	DWORD count = 0;	NDAS_NIF_V1_ENTRY* pEntry;	HRESULT hr = ::NdasNifImport(szFileName, &count, &pEntry);	if (SUCCEEDED(hr))	{		NifEntryArray entryArray;		for (DWORD i = 0; i < count; ++i)		{			ATLTRACE(_T("%d/%d: %s/n"), i+1, count, pEntry->Name);			entryArray.Add(NifEntry(pEntry[i]));		}		if (NULL == m_wndImportDlg.m_hWnd)		{			ATLVERIFY(m_wndImportDlg.Create(m_hWnd, PtrToUlong(&entryArray)));			m_wndImportDlg.CenterWindow(::GetDesktopWindow());			m_wndImportDlg.ShowWindow(SW_SHOWNORMAL);		}		else		{			m_wndImportDlg.AddNifEntry(entryArray);			m_wndImportDlg.SetActiveWindow();		}		ATLVERIFY(NULL == ::LocalFree(pEntry));	}	else	{		ATLTRACE("NdasNifImport Error hr=%x/n", hr);		CString strError;		TCHAR szCompactPath[50];		LPCTSTR lpFileName;		if (::PathCompactPathEx(szCompactPath, szFileName, 50, 0))		{			lpFileName = szCompactPath;		}		else		{			lpFileName = szFileName;		}		strError.FormatMessage(IDS_ERROR_IMPORT_FMT, lpFileName);		ErrorMessageBox(static_cast<LPCTSTR>(strError), IDS_MAIN_TITLE, hr);	}}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:48,


示例17: PtrToUlong

// Worker Thread Start RoutineDWORD CDeviceGeneralPage::OnWorkerThreadStart(LPVOID lpParameter){	UINT i = PtrToUlong(lpParameter);	ATLASSERT(i < RTL_NUMBER_OF(m_pUnitDevices));	if (i >= RTL_NUMBER_OF(m_pUnitDevices))	{		return 255;	}	ndas::UnitDevicePtr pUnitDevice = m_pUnitDevices[i];	if (NULL == pUnitDevice.get())	{		return 1;	}	(void) pUnitDevice->UpdateHostStats();	if (::IsWindow(m_hWnd))	{		ATLVERIFY(PostMessage(WM_USER_DONE, 0, static_cast<LPARAM>(i)));	}	return 0;}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:27,


示例18: ATLVERIFY

inline BYTE IStream::ReadByte(){   BYTE b;   DWORD dwBytesRead = 0;   ATLVERIFY(true == Read(&b, 1, dwBytesRead) && 1 == dwBytesRead);   return b;}
开发者ID:zengnotes,项目名称:MultiplayerOnlineGame,代码行数:7,


示例19: throw

double HighResolutionTimer::TotalElapsed() const throw(){   LARGE_INTEGER lCountNow = {0};   ATLVERIFY(TRUE == ::QueryPerformanceCounter(&lCountNow));   return static_cast<double>(m_lTotalElapsed.QuadPart + (m_bStarted ? (lCountNow.QuadPart-m_lCountStart.QuadPart) : 0LL)) /      GetPerformanceFrequency();}
开发者ID:zengnotes,项目名称:MultiplayerOnlineGame,代码行数:7,


示例20: ATLVERIFY

bool CFotoEntity::findAt(int nX, int nY){	int nR, nL = nX;	ATLVERIFY( addLine(nY, nL, nR) );	CRanges r;	r.push_back( tagUShorts(nL, nR) );	m_mapRanges[nY] = r;		findAtNextLine<-1>(nY-1, nL, nR);	findAtNextLine<1>(nY+1, nL, nR);	int nAdded;	do{		nAdded = 0;		for(std::map<int, CRanges>::iterator it = m_mapRanges.begin(); it != m_mapRanges.end(); it++){			CRanges& r = it->second;			if (r.IsFlag(1|2) == (1|2)) continue;			int nUp = 0, nDown = 0;			for(size_t i=0; i < r.size(); i++){				if (!r.IsFlag(1))					nUp += findAtNextLine<-1>(it->first - 1, r[i].m_us1, r[i].m_us2);				if (!r.IsFlag(2))					nDown += findAtNextLine<1>(it->first + 1, r[i].m_us1, r[i].m_us2);			}			int nFlag = nUp ? 0 : 1;			if (!nDown) nFlag |= 2;			if (nFlag) r.AddFlag( nFlag );			nAdded += nUp + nDown;		}		}while(nAdded);	return true;}
开发者ID:som,项目名称:FED,代码行数:33,


示例21: _tWinMain

int WINAPI _tWinMain( HINSTANCE hInst, HINSTANCE, LPTSTR, int ){	_tsetlocale( LC_ALL, _T(".OCP") );	ATLVERIFY( SUCCEEDED( _Module.Init( NULL, hInst ) ) );	if( !EnableDebugPrivilege() )	{		MessageBoxV( NULL, IDS_NO_DEBUG_PRIVILEGE, MB_OK | MB_ICONHAND );		return 0;	}	InitializeCriticalSection( &g_cs );	LoadInternalExceptionList();	LoadSettings();	DumpInit();	if( !ProcessCommandLine() )	{		AtlInitCommonControls( ICC_BAR_CLASSES );		LoadLibrary( CRichEditCtrl::GetLibraryName() );		CMainDlg dlgMain;		g_pMainWnd = &dlgMain;		int nRet = dlgMain.DoModal();		g_pMainWnd = NULL;	}	DumpUninit();	SaveSettings();	DeleteCriticalSection( &g_cs );	_Module.Term();	return 0;}
开发者ID:localvar,项目名称:backup,代码行数:34,


示例22: ATLVERIFY

LRESULT MsgOnlyWindow::OnInitPlugin(UINT, WPARAM, LPARAM, BOOL& bHandled) {  bHandled = true;  m_plugin->InitFromSavedLastCurrencies();  HRESULT hr = m_plugin->StartDisplayingItems();  ATLVERIFY(SUCCEEDED(hr));  return 0;}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:7,


示例23: throw

HRESULT CSwapAPODllModule::DllRegisterServer(BOOL bRegTypeLib) throw(){    HRESULT hResult;    UINT32 u32APORegIndex = 0;    UINT32 u32APOUnregIndex = 0;    // Register all APOs implemented in this module.    for (u32APORegIndex = 0; u32APORegIndex < SIZEOF_ARRAY(gCoreAPOs); u32APORegIndex++)    {        hResult = RegisterAPO(gCoreAPOs[u32APORegIndex]);        if (FAILED(hResult))        {           goto ExitFailed;        }    }    // Register the module.    hResult = CAtlDllModuleT<CSwapAPODllModule>::DllRegisterServer(bRegTypeLib);    if (FAILED(hResult))    {        goto ExitFailed;    }    return hResult;ExitFailed:    // Unregister all registered APOs if something failed.    for (u32APOUnregIndex = 0; u32APOUnregIndex < u32APORegIndex; u32APOUnregIndex++)    {        ATLVERIFY(SUCCEEDED(UnregisterAPO(gCoreAPOs[u32APOUnregIndex]->clsid)));    }    return hResult;} // DllRegisterServer
开发者ID:0xhack,项目名称:Windows-driver-samples,代码行数:34,


示例24: catch

CDatabase *CCachedDBConnections::GetConnection(const CString &strConnect, BOOL bAutoOpen){    CCacheMap::CPair *pKeyValPair = m_DBCache.PLookup(strConnect);    CDatabase *pDB = NULL;    if (pKeyValPair != NULL)    {        pDB = pKeyValPair->value;    }        if (NULL == pDB)    {        try { pDB = new CDatabase; }        catch (...) { pDB = NULL; }    }    if (pDB != NULL && !pDB->IsOpen() && bAutoOpen)    {        ATLVERIFY(pDB->OpenEx(strConnect,             CDatabase::useCursorLib | CDatabase::noOdbcDialog));    }    if (NULL == pKeyValPair)    {        m_DBCache[strConnect] = pDB;    }    return pDB;}
开发者ID:a524631266,项目名称:Ongoing-Study,代码行数:28,


示例25: HookLoadLibraryW

static HMODULE WINAPI HookLoadLibraryW(PCWSTR lpLibFileName){    PCWSTR pwzName = wcsrchr(lpLibFileName, L'//');    if (NULL != pwzName)        ++pwzName;    else        pwzName = lpLibFileName;    static const PCWSTR pwzDlls[] = {        L"jsdbgui.dll", L"jsprofilerui.dll", L"networkinspection.dll"    };    for (size_t i = 0; i < ARRAYSIZE(pwzDlls); ++i) {        if (0 == _wcsicmp(pwzName, pwzDlls[i])) {            static WCHAR wzIEPath[MAX_PATH] = { 0 };            if (L'/0' == wzIEPath[0]) {                CStaticDataInitCriticalSectionLock lock;                ATLVERIFY(SUCCEEDED(lock.Lock()));                if (L'/0' == wzIEPath[0]) {                    HMODULE hDT = GetModuleHandle(_T("iedvtool.dll"));                    ATLASSERT(NULL != hDT);                    GetModuleFileName(hDT, wzIEPath, MAX_PATH);                    *(wcsrchr(wzIEPath, L'//') + 1) = L'/0';                }                lock.Unlock();            }            wstring wsDll(wzIEPath);            wsDll.append(pwzName);            return RawLoadLibraryW(wsDll.c_str());        }    }    return RawLoadLibraryW(lpLibFileName);}
开发者ID:ArthurJhon,项目名称:SuperF12,代码行数:35,


示例26: GetFileList

std::vector<std::wstring> GetFileList(const std::wstring& pattern, const bool fullPaths){	const std::wstring directory = (fullPaths ? GetDirPart(pattern) : L"");	// may not pass an empty string to FindFirstFileEx	UIETWASSERT(pattern.length() > 0);	// string passed to FindFirstFileEx must not end in a backslash	UIETWASSERT(pattern.back() != L'//');	WIN32_FIND_DATA findData;	HANDLE hFindFile = ::FindFirstFileExW(pattern.c_str(), FindExInfoBasic,				&findData, FindExSearchNameMatch, NULL, 0);	std::vector<std::wstring> result;	if (hFindFile == INVALID_HANDLE_VALUE)	{		// If there are NO matching files, then FindFirstFileExW returns		// INVALID_HANDLE_VALUE and the last error is ERROR_FILE_NOT_FOUND.		UIETWASSERT(::GetLastError() == ERROR_FILE_NOT_FOUND);		return result;	}	do	{		result.emplace_back(directory + findData.cFileName);	} while (::FindNextFileW(hFindFile, &findData));	UIETWASSERT(::GetLastError() == ERROR_NO_MORE_FILES);	ATLVERIFY(::FindClose(hFindFile));	return result;}
开发者ID:fdoray,项目名称:UIforETW,代码行数:31,


示例27: CreateRegistryKey

void CreateRegistryKey(const HKEY root, const std::wstring& subkey, const std::wstring& newKey){	HKEY key;	if (::RegOpenKeyExW(root, subkey.c_str(), 0, KEY_ALL_ACCESS, &key) != ERROR_SUCCESS)		return;	HKEY resultKey;	// TODO: RegCreateKey is deprecated.	const LONG createResult = ::RegCreateKeyW(key, newKey.c_str(), &resultKey);	UIETWASSERT(createResult == ERROR_SUCCESS);	if (createResult == ERROR_SUCCESS)	{		ATLVERIFY(::RegCloseKey(resultKey) == ERROR_SUCCESS);	}	ATLVERIFY(::RegCloseKey(key) == ERROR_SUCCESS);}
开发者ID:fdoray,项目名称:UIforETW,代码行数:16,



注:本文中的ATLVERIFY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ATL_AlignPtr函数代码示例
C++ ATLTRY函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。