本文整理汇总了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;
}
示例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);
}
示例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();
}
示例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
{
;
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}