當前位置: 首頁>>代碼示例>>C++>>正文


C++ ErrorMessageBox函數代碼示例

本文整理匯總了C++中ErrorMessageBox函數的典型用法代碼示例。如果您正苦於以下問題:C++ ErrorMessageBox函數的具體用法?C++ ErrorMessageBox怎麽用?C++ ErrorMessageBox使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ErrorMessageBox函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CoCreateInstance

// loads the demux into the FilterGraph
HRESULT
CBDAFilterGraph::LoadDemux()
{
    HRESULT hr = S_OK;
    
    hr = CoCreateInstance(
            CLSID_MPEG2Demultiplexer, 
            NULL, 
            CLSCTX_INPROC_SERVER,
            IID_IBaseFilter, 
            reinterpret_cast<void**>(&m_pDemux)
            );
    if (FAILED (hr))
    {
        ErrorMessageBox(TEXT("Could not CoCreateInstance CLSID_MPEG2Demultiplexer\n"));
        return hr;
    }

    hr = m_pFilterGraph->AddFilter(m_pDemux, L"Demux");
    if(FAILED(hr))
    {
        ErrorMessageBox(TEXT("Unable to add demux filter to graph\n"));
        return hr;
    }

    return hr;
}
開發者ID:grakidov,項目名稱:Render3D,代碼行數:28,代碼來源:graph.cpp

示例2: CArchiveScanner

bool FileSystemInitializer::Initialize()
{
	if (initSuccess)
		return true;

	try {
		Platform::SetOrigCWD();

		dataDirLocater.LocateDataDirs();
		dataDirLocater.Check();

		archiveScanner = new CArchiveScanner();
		vfsHandler = new CVFSHandler();

		initSuccess = true;
	} catch (const std::exception& ex) {
		// abort VFS-init thread
		initFailure = true;

		// even if we end up here, do not clean up configHandler yet
		// since it can already have early observers registered that
		// do not remove themselves until exit
		Cleanup(false);
		ErrorMessageBox(ex.what(), "Spring: caught std::exception", MBF_OK | MBF_EXCL);
	} catch (...) {
		initFailure = true;

		Cleanup(false);
		ErrorMessageBox("", "Spring: caught generic exception", MBF_OK | MBF_EXCL);
	}

	return (initSuccess && !initFailure);
}
開發者ID:nixtux,項目名稱:spring,代碼行數:33,代碼來源:FileSystemInitializer.cpp

示例3: ErrorMessageBox

void
CMainFrame::OnCmdResetDevice(DWORD dwSlotNo)
{
	ndas::DevicePtr pDevice;
	if (!ndas::FindDeviceBySlotNumber(pDevice, dwSlotNo))
	{
		return;
	}

	if (!pDevice->Enable(FALSE)) 
	{
		ErrorMessageBox(IDS_ERROR_RESET_DEVICE);
		return;
	}

	::SetCursor(AtlLoadSysCursor(IDC_WAIT));

	CSimpleWaitDlg().DoModal(m_hWnd, 2000);

	::SetCursor(AtlLoadSysCursor(IDC_ARROW));

	if (!pDevice->Enable(TRUE)) 
	{
		ErrorMessageBox(IDS_ERROR_RESET_DEVICE);
	}

	ndas::UpdateDeviceList();
}
開發者ID:Nevermore2015,項目名稱:ndas4windows,代碼行數:28,代碼來源:mainframe.cpp

示例4: pTaskDialogVerify

void 
CNdasDevicePropGeneralPage::OnModifyWriteKey(UINT, int, HWND)
{
	ACCESS_MASK access = m_pDevice->GetGrantedAccess();
	
	if (access & GENERIC_WRITE) 
	{
		int response = pTaskDialogVerify(
			m_hWnd,
			IDS_REMOVE_WRITE_KEY_CONFIRM_TITLE,
			IDS_REMOVE_WRITE_KEY_CONFIRM,
			IDS_REMOVE_WRITE_KEY_CONFIRM_DESC,
			_T("DontConfirmRemoveWriteKey"),
			TDCBF_YES_BUTTON | TDCBF_NO_BUTTON,
			IDNO, 
			IDYES);

		if (IDYES == response) 
		{
			BOOL fSuccess = m_pDevice->SetAsReadOnly();
			if (!fSuccess) 
			{
				ErrorMessageBox(m_hWnd, IDS_ERROR_REMOVE_WRITE_KEY);
			}
			else 
			{
				_UpdateDeviceData();
			}
		}
	}
	else 
	{
		CNdasDeviceAddWriteKeyDlg dlg;
		dlg.SetDeviceId(m_pDevice->GetStringId());
		dlg.SetDeviceName(m_pDevice->GetName());
		INT_PTR iResult = dlg.DoModal();

		ATLTRACE("iResult = %d\n", iResult);

		if (iResult == IDOK) 
		{
			BOOL fSuccess = m_pDevice->SetAsReadWrite(dlg.GetWriteKey());
			if (!fSuccess) 
			{
				ErrorMessageBox(m_hWnd, IDS_ERROR_ADD_WRITE_KEY);
			}
			else 
			{
				_UpdateDeviceData();
			}
		}
		else 
		{
			;
		}
	}
}
開發者ID:Nevermore2015,項目名稱:ndas4windows,代碼行數:57,代碼來源:ndasdevicepropgeneralpage.cpp

示例5: DIJoystick_EnumAxisObjectsProc

static int CALLBACK DIJoystick_EnumAxisObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
{
	joystick_type* joystick = (joystick_type*)pvRef;
	DIPROPRANGE diprg;
	HRESULT hr;

	joystick->axes[joystick->num_axes].guid = lpddoi->guidType;
	joystick->axes[joystick->num_axes].name = (TCHAR *)malloc((_tcslen(lpddoi->tszName) + 1) * sizeof(TCHAR));
	_tcscpy(joystick->axes[joystick->num_axes].name, lpddoi->tszName);
	joystick->axes[joystick->num_axes].offset = lpddoi->dwOfs;

	/*ErrorMessageBox("got axis %s, offset %i",lpddoi->tszName, lpddoi->dwOfs);*/

	memset(&diprg, 0, sizeof(DIPROPRANGE));
	diprg.diph.dwSize = sizeof(DIPROPRANGE);
	diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
	diprg.diph.dwObj = lpddoi->dwOfs;
	diprg.diph.dwHow = DIPH_BYOFFSET;
	diprg.lMin = 0;
	diprg.lMax = 255;

	hr = IDirectInputDevice2_SetProperty(joystick->did, DIPROP_RANGE, &diprg.diph);

	if (FAILED(hr)) /* if this fails, don't use this axis */
	{
		free(joystick->axes[joystick->num_axes].name);
		joystick->axes[joystick->num_axes].name = NULL;
		return DIENUM_CONTINUE;
	}

#ifdef JOY_DEBUG
	if (FAILED(hr))
	{
		ErrorMessageBox("DirectInput SetProperty() joystick axis %s failed - %s\n",
				 joystick->axes[joystick->num_axes].name,
				 DirectXDecodeError(hr));
	}
#endif

	/* Set axis dead zone to 0; we need accurate #'s for analog joystick reading. */
	SetDIDwordProperty(joystick->did, DIPROP_DEADZONE, lpddoi->dwOfs, DIPH_BYOFFSET, 0);

#ifdef JOY_DEBUG
	if (FAILED(hr))
	{
		ErrorMessageBox("DirectInput SetProperty() joystick axis %s dead zone failed - %s\n",
				 joystick->axes[joystick->num_axes].name,
				 DirectXDecodeError(hr));
	}
#endif

	joystick->num_axes++;
	return DIENUM_CONTINUE;
}
開發者ID:Robbbert,項目名稱:store1,代碼行數:54,代碼來源:dinputjoy.cpp

示例6: ErrorMessageBox

HRESULT
CBDAFilterGraph::ChangeChannel(
        LONG lMajorChannel, 
        LONG lMinorChannel
        )
{
    HRESULT hr = S_OK;
    m_lMajorChannel = lMajorChannel;
    m_lMinorChannel = lMinorChannel;

    CComPtr <IScanningTuner> pIScanningTuner;

    if (!m_pNetworkProvider)
    {
        ErrorMessageBox(TEXT("The FilterGraph is not yet built.\n"));
        return E_FAIL;
    }

    hr = m_pNetworkProvider.QueryInterface (&pIScanningTuner);
    if (FAILED(hr))
    {
        ErrorMessageBox(TEXT("Cannot QI for IScanningTuner\n"));
        return hr;
    }


    // create tune request
    CComPtr <IATSCChannelTuneRequest> pTuneRequest;
    hr = CreateATSCTuneRequest(
        m_lPhysicalChannel, 
        lMajorChannel, 
        lMinorChannel,
        &pTuneRequest
        );

    if(SUCCEEDED(hr))
    {
        hr = m_pITuner->put_TuneRequest (pTuneRequest);
        if (FAILED (hr))
            ErrorMessageBox(TEXT("Cannot submit tune request\n"));
    }
    else
    {
        ErrorMessageBox(TEXT("Cannot Change Channels\n"));
    }

    return hr;
}
開發者ID:grakidov,項目名稱:Render3D,代碼行數:48,代碼來源:graph.cpp

示例7: error_code_messagebox

static void error_code_messagebox(HWND hwnd, DWORD error_code)
{
    TCHAR title[256];
    if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title)))
        lstrcpy(title, TEXT("Error"));
    ErrorMessageBox(hwnd, title, error_code);
}
開發者ID:HBelusca,項目名稱:NasuTek-Odyssey,代碼行數:7,代碼來源:edit.c

示例8: MainFunc

void MainFunc(int argc, char** argv, int* ret) {
#ifdef __MINGW32__
	// For the MinGW backtrace() implementation we need to know the stack end.
	{
		extern void* stack_end;
		char here;
		stack_end = (void*) &here;
	}
#endif

	while (!Threading::IsMainThread())
		;

#ifdef USE_GML
	set_threadnum(GML_DRAW_THREAD_NUM);
  #if GML_ENABLE_TLS_CHECK
	if (gmlThreadNumber != GML_DRAW_THREAD_NUM) {
		ErrorMessageBox("Thread Local Storage test failed", "GML error:", MBF_OK | MBF_EXCL);
	}
  #endif
#endif

	try {
		SpringApp app;
		*ret = app.Run(argc, argv);
	} CATCH_SPRING_ERRORS
}
開發者ID:niavok,項目名稱:spring,代碼行數:27,代碼來源:Main.cpp

示例9: ATLASSERT

void
CDeviceAdvancedPage::OnDeactivateDevice(UINT uCode, int nCtrlID, HWND hwndCtrl)
{
	ATLASSERT(NULL != m_pDevice.get());

	CString strMessage = (LPCTSTR) IDS_CONFIRM_DEACTIVATE_DEVICE;
	CString strTitle = (LPCTSTR) IDS_MAIN_TITLE;

	ATLASSERT(!strMessage.IsEmpty());
	ATLASSERT(!strTitle.IsEmpty());

	INT_PTR iResponse = MessageBox(
		strMessage, 
		strTitle, 
		MB_YESNO | MB_ICONQUESTION);

	if (IDYES != iResponse) 
	{
		return;
	}

	if (!m_pDevice->Enable(FALSE)) 
	{
		ErrorMessageBox(m_hWnd, IDS_ERROR_DISABLE_DEVICE);
	}

	m_wndDeactivate.EnableWindow(FALSE);
	m_wndReset.EnableWindow(FALSE);
}
開發者ID:tigtigtig,項目名稱:ndas4windows,代碼行數:29,代碼來源:devpropsh.cpp

示例10: VERIFY

LPBYTE CBZDoc::QueryMapView1(LPBYTE pBegin, DWORD dwOffset)
{
    LPBYTE p = pBegin + dwOffset;
    if(IsOutOfMap1(p)) {
        if(p == m_pData + m_dwTotal && p == m_pMapStart + m_dwMapSize) return pBegin;	// ###1.61a
        DWORD dwBegin = pBegin - m_pData;
        VERIFY(::UnmapViewOfFile(m_pMapStart));
        m_dwFileOffset = (p - m_pData) & FILEOFFSET_MASK;
        m_dwMapSize = min(options.dwMaxMapSize, m_dwTotal - m_dwFileOffset);
        if(m_dwMapSize == 0) {	// ###1.61a
            m_dwFileOffset = (m_dwTotal - (~FILEOFFSET_MASK + 1)) & FILEOFFSET_MASK;
            m_dwMapSize = m_dwTotal - m_dwFileOffset;
        }
        m_pMapStart = (LPBYTE)::MapViewOfFile(m_hMapping, m_bReadOnly ? FILE_MAP_READ : FILE_MAP_WRITE, 0, m_dwFileOffset, m_dwMapSize);
        TRACE("MapViewOfFile Doc=%X, %X, Offset:%X, Size:%X\n", this, m_pMapStart, m_dwFileOffset, m_dwMapSize);
        if(!m_pMapStart) {
            ErrorMessageBox();
            AfxPostQuitMessage(0);
            return NULL;
        }
        m_pData = m_pMapStart - m_dwFileOffset;
        pBegin = m_pData + dwBegin;
    }
    return pBegin;
}
開發者ID:tnzk,項目名稱:bz,代碼行數:25,代碼來源:BZDoc.cpp

示例11: NewHandler

	void NewHandler() {
		LOG_L(L_ERROR, "Failed to allocate memory"); // make sure this ends up in the log also

		OutputStacktrace();

		ErrorMessageBox("Failed to allocate memory", "Spring: Fatal Error", MBF_OK | MBF_CRASH);
	}
開發者ID:304471720,項目名稱:spring,代碼行數:7,代碼來源:CrashHandler.cpp

示例12: ATLASSERT

void
CNdasDevicePropAdvancedPage::OnDeactivateDevice(UINT uCode, int nCtrlID, HWND hwndCtrl)
{
	ATLASSERT(NULL != m_pDevice.get());

	int response = AtlTaskDialogEx(
		m_hWnd,
		IDS_MAIN_TITLE,
		IDS_CONFIRM_DEACTIVATE_DEVICE,
		IDS_CONFIRM_DEACTIVATE_DEVICE_DESC,
		TDCBF_YES_BUTTON | TDCBF_NO_BUTTON,
		TD_INFORMATION_ICON);

	if (IDYES != response) 
	{
		return;
	}

	if (!m_pDevice->Enable(FALSE)) 
	{
		ErrorMessageBox(m_hWnd, IDS_ERROR_DISABLE_DEVICE);
	}

	m_wndDeactivate.EnableWindow(FALSE);
	m_wndReset.EnableWindow(FALSE);
}
開發者ID:Nevermore2015,項目名稱:ndas4windows,代碼行數:26,代碼來源:ndasdevicepropadvancedpage.cpp

示例13: ErrorMessageBox

void EAE_Engine::Tools::OutputErrorMessage( const char* const i_errorMessage, const char* const i_optionalFileName )
{
    // This formatting causes the errors to show up in Visual Studio's "Error List" tab
    std::cerr << ( i_optionalFileName ? i_optionalFileName : "Asset Build" ) << ": error: " << i_errorMessage << "\n";
    ErrorMessageBox(i_errorMessage);
//	DEBUG_PRINT("For file %s, Asset Build: error: %s\n", i_optionalFileName, i_errorMessage);
}
開發者ID:leonpardlee,項目名稱:CDEngine,代碼行數:7,代碼來源:UtilityFunctions.cpp

示例14: main

/**
 * @brief main
 * @return exit code
 * @param argc argument count
 * @param argv array of argument strings
 *
 * Main entry point function
 */
int main(int argc, char* argv[])
{
// PROFILE builds exit on execv ...
// HEADLESS run mostly in parallel for testing purposes, 100% omp threads wouldn't help then
#if !defined(PROFILE) && !defined(HEADLESS)
	bool restart = false;
	restart |= SetNvOptimusProfile(argv);
	restart |= SetOpenMpEnvVars(argv);

  #ifndef WIN32
	if (restart) {
		std::vector<std::string> args(argc-1);
		for (int i=1; i<argc; i++) {
			args[i-1] = argv[i];
		}
		const std::string err = Platform::ExecuteProcess(argv[0], args);
		ErrorMessageBox(err, "Execv error:", MBF_OK | MBF_EXCL);
	}
  #endif
#endif
	int ret = Run(argc, argv);
	std::string exe = EngineTypeHandler::GetRestartExecutable();
	if (exe != "") {
		std::vector<std::string> args;
		for (int i=1; i<argc; i++)
			args.push_back(argv[i]);
		if (!EngineTypeHandler::RestartEngine(exe, args)) {
			handleerror(NULL, EngineTypeHandler::GetRestartErrorMessage(), "Missing engine type", MBF_OK | MBF_EXCL);
		}
	}
	return ret;
}
開發者ID:AlexDiede,項目名稱:spring,代碼行數:40,代碼來源:Main.cpp

示例15: UnloadHive

static BOOL UnloadHive(HWND hWnd)
{
    WCHAR Caption[128];
    LPCWSTR pszKeyPath;
    HKEY hRootKey;
    LONG regUnloadResult;

    /* get the item key to unload */
    pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
    /* load and set the caption and flags for dialog */
    LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));

    /* Enable the 'restore' privilege, unload the hive, disable the privilege */
    EnablePrivilege(SE_RESTORE_NAME, NULL, TRUE);
    regUnloadResult = RegUnLoadKeyW(hRootKey, pszKeyPath);
    EnablePrivilege(SE_RESTORE_NAME, NULL, FALSE);

    if(regUnloadResult == ERROR_SUCCESS)
    {
        /* refresh tree and list views */
        RefreshTreeView(g_pChildWnd->hTreeWnd);
        pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
        RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
    }
    else
    {
        ErrorMessageBox(hWnd, Caption, regUnloadResult);
        return FALSE;
    }
    return TRUE;
}
開發者ID:hoangduit,項目名稱:reactos,代碼行數:31,代碼來源:framewnd.c


注:本文中的ErrorMessageBox函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。