本文整理汇总了C++中NotifyError函数的典型用法代码示例。如果您正苦于以下问题:C++ NotifyError函数的具体用法?C++ NotifyError怎么用?C++ NotifyError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NotifyError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CREATE_AND_OPEN_OUTPUT_FILE
void DataGenerator::_export_raw_data(GUINT32 num_bytes,
const QString &fn)
{
bool success = false;
try{
CREATE_AND_OPEN_OUTPUT_FILE(fn);
class rng_data_source : public GUtil::IInput{
GUtil::CryptoPP::RNG &m_rng;
public:
rng_data_source(GUtil::CryptoPP::RNG &r) :m_rng(r) {}
virtual GUINT32 ReadBytes(byte *b, GUINT32 len, GUINT32 to_read){
to_read = Min(len, to_read);
m_rng.Fill(b, to_read);
return to_read;
}
} rng_source(m_rng);
rng_source.Pump(&outfile, num_bytes, DEFAULT_CHUNK_SIZE,
[&](int p) -> bool{
emit ProgressUpdated(p);
return m_cancel;
});
success = true;
}
catch(const Exception<> &ex){
emit NotifyError(std::shared_ptr<std::exception>(
static_cast<std::exception*>((Exception<> *)ex.Clone()))
);
}
if(success)
emit NotifyInfo(tr("Raw data exported"));
}
开发者ID:karagog,项目名称:Gryptonite,代码行数:34,代码来源:datagenerator.cpp
示例2: NotifyError
void
nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* aPosition)
{
if (mCleared || !mAllowed)
return;
// we should not pass null back to the DOM.
if (!aPosition) {
NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE);
return;
}
// Ensure that the proper context is on the stack (bug 452762)
nsCOMPtr<nsIJSContextStack> stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1"));
if (!stack || NS_FAILED(stack->Push(nsnull)))
return; // silently fail
mCallback->HandleEvent(aPosition);
// remove the stack
JSContext* cx;
stack->Pop(&cx);
mHasSentData = PR_TRUE;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:25,代码来源:nsGeolocation.cpp
示例3: mysql_real_query
bool CMySqlDatabase::DbCrud( QString& strSql, QString& strError )
{
//
// Unicode(UCS) =====> MBCS
//
if ( bExpiration ) {
return false;
}
QByteArray byteSql = pCodec->fromUnicode( strSql );
int nSize = byteSql.count( );
const char* pSql = byteSql.data( );
int nRet = mysql_real_query( &hConnect, pSql, nSize );
GetErrorMsg( nRet, strError, true, strSql );
//mysql_num_rows();
bool bRet = ( 0 == nRet );
if ( !bRet ) {
strError = "访问数据库失败,可能是网络故障,请检查网络!\n" + strError;
//CCommonFunction::MsgBox( NULL, "提示", strError, QMessageBox::Information );
//CStartupProcess::GetFrame( )->UpdateInfo( strError );
emit NotifyError( strError );
}
return bRet;
}
开发者ID:Strongc,项目名称:SCPark,代码行数:30,代码来源:mysqldatabase.cpp
示例4: NS_FAILED_WARN
NS_IMETHODIMP ItemTask::Run() {
int ret = EWS_FAIL;
char * err_msg = NULL;
void * remoteResponse = NULL;
if (EWS_FAIL == NotifyBegin(this)) {
return NS_OK;
}
NS_FAILED_WARN(m_ItemsCallback->RemoteOperation(&remoteResponse));
m_ItemsCallback->GetRemoteResult(&ret);
m_ItemsCallback->GetRemoteMessage(&err_msg);
NotifyError(this, ret, err_msg);
nsCOMPtr<nsIRunnable> resultrunnable =
new ItemDoneTask(ret,
m_ItemsCallback,
remoteResponse,
m_pEwsTaskCallbacks,
this);
NS_DispatchToMainThread(resultrunnable);
return NS_OK;
}
开发者ID:stonewell,项目名称:exchange-ews-thunderbird,代码行数:26,代码来源:MailEwsItemTask.cpp
示例5: SendMessageReply
NS_IMETHODIMP
SmsRequest::NotifyThreadListFailed(int32_t aError)
{
if (mParent) {
return SendMessageReply(MessageReply(ReplyThreadListFail(aError)));
}
return NotifyError(aError);
}
开发者ID:vvuk,项目名称:mozilla-central,代码行数:8,代码来源:SmsRequest.cpp
示例6: Run
NS_IMETHOD Run() {
nsresult rv;
nsCOMPtr<IMailEwsMsgFolder> ewsFolder(do_QueryInterface(m_Folder, &rv));
if (NS_FAILED(rv)) {
NotifyError(m_Runnable, (int)rv, "unable to get ews folder");
} else if (m_Result == EWS_SUCCESS) {
rv = ewsFolder->ClientRename(m_NewName, m_MsgWindow);
if (NS_FAILED(rv)) {
NotifyError(m_Runnable, (int)rv, "unable to rename folder");
}
}
NotifyEnd(m_Runnable, m_Result);
return NS_OK;
}
开发者ID:stonewell,项目名称:exchange-ews-thunderbird,代码行数:17,代码来源:MailEwsRenameFolderTask.cpp
示例7: NotifyError
void View_Cancha::initialize(SDL_Renderer * gRenderer)
{
if( !texturaCancha.loadFromFile( "Images/canchafubol.jpg",gRenderer) )
{
NotifyError("No se pudo cargar la Imagen de la cancha, se usara una imagen por defecto", "View_Jugador");
texturaCancha.loadFromFile("Images/pelota.png",gRenderer);
}
}
开发者ID:gutierrezmatias,项目名称:TP,代码行数:8,代码来源:View_Cancha.cpp
示例8: NotifyError
bool CError::NotifyError( LPSTR szFilename, int iLine, int iColumn, DWORD dwStrResourceDescription)
{
WCHAR szBuffer[ MAX_LANG_ERROR_STR];
if( 0 >= LoadStringW( NULL, dwStrResourceDescription, szBuffer, sizeof(szBuffer)))
return FALSE;
return NotifyError( szFilename, iLine, iColumn, szBuffer);
}
开发者ID:fschwiet,项目名称:ArchiveOfLore,代码行数:9,代码来源:Error.cpp
示例9: OnFileOpen
// Open an audio/video file.
void OnFileOpen(HWND hwnd)
{
IFileOpenDialog *pFileOpen = NULL;
IShellItem *pItem = NULL;
PWSTR pszFilePath = NULL;
// Create the FileOpenDialog object.
HRESULT hr = CoCreateInstance(__uuidof(FileOpenDialog), NULL,
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pFileOpen));
if (FAILED(hr))
{
goto done;
}
// Show the Open dialog box.
hr = pFileOpen->Show(NULL);
if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED))
{
// The user canceled the dialog. Do not treat as an error.
hr = S_OK;
goto done;
}
else if (FAILED(hr))
{
goto done;
}
// Get the file name from the dialog box.
hr = pFileOpen->GetResult(&pItem);
if (FAILED(hr))
{
goto done;
}
hr = pItem->GetDisplayName(SIGDN_FILESYSPATH, &pszFilePath);
if (FAILED(hr))
{
goto done;
}
// Display the file name to the user.
hr = g_pPlayer->OpenURL(pszFilePath);
if (SUCCEEDED(hr))
{
UpdateUI(hwnd, OpenPending);
}
done:
if (FAILED(hr))
{
NotifyError(hwnd, L"Could not open the file.", hr);
UpdateUI(hwnd, Closed);
}
CoTaskMemFree(pszFilePath);
SafeRelease(&pItem);
SafeRelease(&pFileOpen);
}
开发者ID:TimSC,项目名称:wmf-video-player-example,代码行数:58,代码来源:winmain.cpp
示例10: OnPlayerEvent
// Handler for Media Session events.
void OnPlayerEvent(HWND hwnd, WPARAM pUnkPtr)
{
HRESULT hr = g_pPlayer->HandleEvent(pUnkPtr);
if (FAILED(hr))
{
NotifyError(hwnd, L"An error occurred.", hr);
}
UpdateUI(hwnd, g_pPlayer->GetState());
}
开发者ID:TimSC,项目名称:wmf-video-player-example,代码行数:10,代码来源:winmain.cpp
示例11: EnterCriticalSection
HRESULT CPreview::OnReadSample(
HRESULT hrStatus,
DWORD /* dwStreamIndex */,
DWORD /* dwStreamFlags */,
LONGLONG /* llTimestamp */,
IMFSample *pSample // Can be NULL
)
{
HRESULT hr = S_OK;
IMFMediaBuffer *pBuffer = NULL;
EnterCriticalSection(&m_critsec);
if (FAILED(hrStatus))
{
hr = hrStatus;
}
if (SUCCEEDED(hr))
{
if (pSample)
{
// Get the video frame buffer from the sample.
hr = pSample->GetBufferByIndex(0, &pBuffer);
// Draw the frame.
if (SUCCEEDED(hr))
{
hr = m_draw.DrawFrame(pBuffer);
}
}
}
// Request the next frame.
if (SUCCEEDED(hr))
{
hr = m_pReader->ReadSample(
(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
0,
NULL, // actual
NULL, // flags
NULL, // timestamp
NULL // sample
);
}
if (FAILED(hr))
{
NotifyError(hr);
}
SafeRelease(&pBuffer);
LeaveCriticalSection(&m_critsec);
return hr;
}
开发者ID:bmharper,项目名称:mvision,代码行数:57,代码来源:preview.cpp
示例12: NotifyError
NS_IMETHODIMP
MobileMessageCallback::NotifyGetSmscAddress(const nsAString& aSmscAddress)
{
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.Init(mDOMRequest->GetOwner()))) {
return NotifyError(nsIMobileMessageCallback::INTERNAL_ERROR);
}
JSContext* cx = jsapi.cx();
JSString* smsc = JS_NewUCStringCopyN(cx, aSmscAddress.BeginReading(),
aSmscAddress.Length());
if (!smsc) {
return NotifyError(nsIMobileMessageCallback::INTERNAL_ERROR);
}
JS::Rooted<JS::Value> val(cx, JS::StringValue(smsc));
return NotifySuccess(val);
}
开发者ID:hoosteeno,项目名称:gecko-dev,代码行数:18,代码来源:MobileMessageCallback.cpp
示例13: if
// Append a string as a token to the token vector
int CExpression::AppendString(const char* str, bool editorMode, bool singleQuotes)
{
Token Tok;
int i;
for (i = 1; ; i++) {
// End quote and not a "" double quote escape
if (str[i] == '"') {
// Double ""
if (!singleQuotes && str[i+1] == '"') {
Tok.str += '"';
if(editorMode)
Tok.str += '"';
i++; // Skip
}
else
// Terminate
break;
}
else if (singleQuotes && str[i] == '\'')
{
break;
}
// Null found inside string
else if (str[i] == NULL) {
// Report an error (string not closed)
NotifyError("Syntax error: Unclosed string quote");
i--;
break; // exit
}
else
Tok.str += str[i];
}//for
// Append this token
if (singleQuotes)
Tok.t = T_VARIABLENAME;
else {
Tok.str.Replace("$n", "\n");
Tok.str.Replace("$q", "\"");
Tok.str.Replace("$t", "\t");
Tok.t = T_STRINGLITERAL;
}
Tok.length = Tok.str.GetLength() + 2; // Don't forget the quotes
toks.push_back(Tok);
return i;
}
开发者ID:aolko,项目名称:construct,代码行数:56,代码来源:CExpression.cpp
示例14: GetRequest
NS_IMETHODIMP
SmsRequestManager::NotifyReadMessageListFailed(PRInt32 aRequestId, PRInt32 aError)
{
SmsRequest* request = GetRequest(aRequestId);
nsCOMPtr<nsIDOMMozSmsCursor> cursor = request->GetCursor();
if (cursor) {
static_cast<SmsCursor*>(cursor.get())->Disconnect();
}
return NotifyError(aRequestId, aError);
}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:12,代码来源:SmsRequestManager.cpp
示例15: wxCHECK_MSG
bool wxLuaDebugTarget::Run()
{
wxCHECK_MSG(m_pThread == NULL, false, wxT("wxLuaDebugTarget::Run already called"));
// Assume something is going to go wrong
m_fErrorsSeen = true;
m_pThread = new LuaThread(this);
// Start the thread
if ((m_pThread != NULL) &&
(m_pThread->Create() == wxTHREAD_NO_ERROR) &&
(m_pThread->Run() == wxTHREAD_NO_ERROR))
{
// Wait for the connection to the server to complete
if (!IsConnected())
{
wxMessageBox(wxT("Unable to connect to server"), wxT("wxLua client"), wxOK | wxCENTRE, NULL);
}
else
{
// OK, now we can start running.
m_runCondition.Wait();
m_fRunning = true;
m_fErrorsSeen = false;
size_t idx, count = m_bufferArray.GetCount();
for (idx = 0; idx < count; ++idx)
{
wxString luaBuffer = m_bufferArray.Item(idx);
wxString bufFilename = luaBuffer.BeforeFirst(wxT('\0'));
wxString buf = luaBuffer.AfterFirst(wxT('\0'));
wxLuaCharBuffer char_buf(buf);
int rc = m_wxlState.LuaDoBuffer(char_buf, char_buf.Length(),
wx2lua(bufFilename));
m_fErrorsSeen = (rc != 0);
if (m_fErrorsSeen)
{
NotifyError(wxlua_LUA_ERR_msg(rc));
break;
}
}
m_bufferArray.Clear();
}
}
return !m_fErrorsSeen;
}
开发者ID:henryfung01,项目名称:GameCode4,代码行数:51,代码来源:wxldtarg.cpp
示例16: ui
DataGenerator::DataGenerator(QWidget *parent)
:QWidget(parent),
ui(new Ui::DataGenerator),
m_cancel(false)
{
ui->setupUi(this);
// This connection will be queued because errors are emitted
// from the background thread
connect(this, SIGNAL(NotifyError(std::shared_ptr<std::exception>)),
this, SLOT(_handle_error(std::shared_ptr<std::exception>)));
connect(this, SIGNAL(ProgressUpdated(int)), this, SLOT(_handle_progress(int)));
}
开发者ID:karagog,项目名称:Gryptonite,代码行数:14,代码来源:datagenerator.cpp
示例17: JS_NewUCStringCopyN
NS_IMETHODIMP
MobileMessageCallback::NotifyGetSmscAddress(const nsAString& aSmscAddress)
{
AutoJSContext cx;
JSString* smsc = JS_NewUCStringCopyN(cx,
static_cast<const jschar *>(aSmscAddress.BeginReading()),
aSmscAddress.Length());
if (!smsc) {
return NotifyError(nsIMobileMessageCallback::INTERNAL_ERROR);
}
JS::Rooted<JS::Value> val(cx, STRING_TO_JSVAL(smsc));
return NotifySuccess(val);
}
开发者ID:JCROM-FxOS,项目名称:b2jc_gecko,代码行数:15,代码来源:MobileMessageCallback.cpp
示例18: OnCreateWindow
// Handler for WM_CREATE message.
LRESULT OnCreateWindow(HWND hwnd)
{
// Initialize the player object.
HRESULT hr = CPlayer::CreateInstance(hwnd, hwnd, &g_pPlayer);
if (SUCCEEDED(hr))
{
UpdateUI(hwnd, Closed);
return 0; // Success.
}
else
{
NotifyError(NULL, L"Could not initialize the player object.", hr);
return -1; // Destroy the window
}
}
开发者ID:TimSC,项目名称:wmf-video-player-example,代码行数:16,代码来源:winmain.cpp
示例19: ZeroMemory
void MainWindow::OnFileOpen()
{
OPENFILENAME ofn;
ZeroMemory(&ofn, sizeof(ofn));
WCHAR szFileName[MAX_PATH];
szFileName[0] = L'\0';
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = m_hwnd;
ofn.hInstance = m_hInstance;
ofn.lpstrFilter = L"All (*.*)/0*.*/0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_FILEMUSTEXIST;
HRESULT hr;
if (GetOpenFileName(&ofn))
{
hr = m_pPlayer->OpenFile(szFileName);
// Update the state of the UI.
UpdateUI();
// Invalidate the appliction window, in case there is an old video
// frame from the previous file and there is no video now. (eg, the
// new file is audio only, or we failed to open this file.)
InvalidateRect(m_hwnd, NULL, FALSE);
// Update the seek bar to match the current state.
UpdateSeekBar();
if (SUCCEEDED(hr))
{
// If this file has a video stream, we need to notify
// the VMR about the size of the destination rectangle.
// Invoking our OnSize() handler does this.
OnSize();
}
else
{
NotifyError(m_hwnd, TEXT("Cannot open this file."), hr);
}
}
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:48,代码来源:MainWindow.cpp
示例20: LOG
void
MediaRecorder::Resume(ErrorResult& aResult)
{
LOG(PR_LOG_DEBUG, ("MediaRecorder.Resume"));
if (mState != RecordingState::Paused) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
MOZ_ASSERT(mSessions.Length() > 0);
nsresult rv = mSessions.LastElement()->Resume();
if (NS_FAILED(rv)) {
NotifyError(rv);
return;
}
mState = RecordingState::Recording;
}
开发者ID:franzks,项目名称:gecko-dev,代码行数:17,代码来源:MediaRecorder.cpp
注:本文中的NotifyError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论