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


C++ AddMessage函數代碼示例

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


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

示例1: ActionCallback

VOID ActionCallback(PTP_CALLBACK_INSTANCE Instance, PVOID Context) {

   PCALLBACK_DATA pData = (PCALLBACK_DATA)Context; 

   // Compute a pseudo duration for the action based on its name
   DWORD dwDuration = (DWORD)_tcslen(pData->szAction);

   AddMessage(
      TEXT("[%u] '%s' starting for %u seconds."), 
      GetCurrentThreadId(), pData->szAction, dwDuration);

   // Simulate a lot of work
   Sleep(dwDuration * 1000);

   AddMessage(
      TEXT("[%u] '%s' is done."), 
      GetCurrentThreadId(), pData->szAction);

   // Ask the thread pool to set the synchronization event 
   // after this callback finishes
   SetEventWhenCallbackReturns(Instance, pData->finishEvent);

   // Don't forget to clean up the given parameter data block
   delete (pData);
}
開發者ID:Jeanhwea,項目名稱:WindowsViaCPP,代碼行數:25,代碼來源:PrivateBatch.cpp

示例2: Logic_error

InternalException::InternalException(const char* c) : Logic_error()
{
   Select = BaseException::Select;
   AddMessage("internal error detected by Newmat: please inform author\n");
   AddMessage(c); AddMessage("\n\n");
   Tracer::AddTrace();
}
開發者ID:BloodyPudding,項目名稱:Sign_Language_Recognition,代碼行數:7,代碼來源:newmatex.cpp

示例3: BaseException

Runtime_error::Runtime_error(const char* a_what)
   : BaseException()
{
   Select = BaseException::Select;
   AddMessage("Runtime error:- "); AddMessage(a_what);
   if (a_what) Tracer::AddTrace();
}
開發者ID:sodatoad,項目名稱:quantiNEMO_Taylor2010,代碼行數:7,代碼來源:myexcept.cpp

示例4: AddMessage

NVENCSTATUS NVEncFilterDenoiseGauss::init(shared_ptr<NVEncFilterParam> pParam, shared_ptr<RGYLog> pPrintMes) {
    NVENCSTATUS sts = NV_ENC_SUCCESS;
    m_pPrintMes = pPrintMes;
    auto pGaussParam = std::dynamic_pointer_cast<NVEncFilterParamGaussDenoise>(pParam);
    if (!pGaussParam) {
        AddMessage(RGY_LOG_ERROR, _T("Invalid parameter type.\n"));
        return NV_ENC_ERR_INVALID_PARAM;
    }
    if (!check_if_nppi_dll_available()) {
        AddMessage(RGY_LOG_ERROR, _T("vpp-gauss requires \"%s\", not available on your system.\n"), NPPI_DLL_NAME);
        return NV_ENC_ERR_INVALID_PARAM;
    }
    //パラメータチェック
    if (pGaussParam->frameOut.height <= 0 || pGaussParam->frameOut.width <= 0) {
        AddMessage(RGY_LOG_ERROR, _T("Invalid parameter.\n"));
        return NV_ENC_ERR_INVALID_PARAM;
    }

    auto cudaerr = AllocFrameBuf(pGaussParam->frameOut, 1);
    if (cudaerr != CUDA_SUCCESS) {
        AddMessage(RGY_LOG_ERROR, _T("failed to allocate memory: %s.\n"), char_to_tstring(cudaGetErrorName(cudaerr)).c_str());
        return NV_ENC_ERR_OUT_OF_MEMORY;
    }
    pGaussParam->frameOut.pitch = m_pFrameBuf[0]->frame.pitch;

    m_sFilterInfo = strsprintf(_T("denoise(gauss): mask size: %s"), get_chr_from_value(list_nppi_gauss, pGaussParam->masksize));

    m_pParam = pParam;
    return sts;
}
開發者ID:ming-hai,項目名稱:NVEnc,代碼行數:30,代碼來源:NVEncFilterDenoiseGauss.cpp

示例5: Exception

SolutionException::SolutionException(const char* a_what) : Exception()
{
   Select = Exception::Select;
   AddMessage("Error detected by solution package\n");
   AddMessage(a_what); AddMessage("\n");
   if (a_what) Tracer::AddTrace();
};
開發者ID:Jornason,項目名稱:DieHard,代碼行數:7,代碼來源:solution.cpp

示例6: Dlg_Proc

INT_PTR WINAPI Dlg_Proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {

   switch (uMsg) {
      chHANDLE_DLGMSG(hwnd, WM_INITDIALOG, Dlg_OnInitDialog);
      chHANDLE_DLGMSG(hwnd, WM_COMMAND,    Dlg_OnCommand);
      case WM_APP_COMPLETED:
      {
         AddMessage(
            TEXT("[%u] ____Whole batch is over____"), 
            GetCurrentThreadId());

         // Don't forget to clean up given synchronization data
         PSYNCHRO_DATA pData = (PSYNCHRO_DATA)lParam;
         for (DWORD current = 0; current < pData->Count; current++) {
            if (!CloseHandle(pData->Handles[current])) {
               AddMessage(
                  TEXT("[%u] Error %u when closing handle %u"), 
                  GetCurrentThreadId(), GetLastError(), current);
            }
         }
         g_hEmailEvent = NULL;
         g_hPrintEvent = NULL;
         delete (pData);
      }
      break;
   }

   return(FALSE);
}
開發者ID:Jeanhwea,項目名稱:WindowsViaCPP,代碼行數:29,代碼來源:PrivateBatch.cpp

示例7: QextSerialPort

void frmClient::on_btnOpen_clicked()
{
    if (ui->btnOpen->text() == "打開") {
        COM = new QextSerialPort(ui->cboxPortName->currentText());
        bool IsOpen = COM->open(QIODevice::WriteOnly);
        if (IsOpen) {
            COM->flush();//清空串口緩衝區
            COM->setBaudRate(BAUD2400);
            COM->setDataBits(DATA_8);
            COM->setParity(PAR_NONE);
            COM->setStopBits(STOP_1);
            COM->setFlowControl(FLOW_OFF);
            COM->setTimeout(10);

            //開啟定時器發送心跳數據
            timerHeart->start();
            ui->btnOpen->setText("關閉");
            AddMessage("串口打開成功");

            SendACK();
        } else {
            AddMessage("串口打開失敗");
        }
    } else {
        timerHeart->stop();
        COM->close();
        ui->btnOpen->setText("打開");
        AddMessage("串口關閉成功");
    }
}
開發者ID:feiyangqingyun,項目名稱:DS7400Tool,代碼行數:30,代碼來源:frmclient.cpp

示例8: Runtime_error

OverflowException::OverflowException(const char* c) : Runtime_error()
{
   Select = BaseException::Select;
   AddMessage("detected by Newmat: ");
   AddMessage(c); AddMessage("\n\n");
   if (c) Tracer::AddTrace();
}
開發者ID:BloodyPudding,項目名稱:Sign_Language_Recognition,代碼行數:7,代碼來源:newmatex.cpp

示例9: iter

void TGo4LogInfo::linkedObjectUpdated(const char * linkname, TObject * obj)
{
   TList* lst = dynamic_cast<TList*>(obj);
   if (lst != 0) {
      TListIter iter(lst, kFALSE);
      TObject* obj = 0;
      while ((obj = iter()) != 0) {
         // first item is id of current status message, used to submit next request
         if (obj==lst->First()) continue;

         const char* msg = obj->GetName();

         const char* separ = strchr(msg,':');
         if ((separ==0) || (strlen(separ)<3)) continue;

         Long64_t tm = TString(msg, separ-msg).Atoll();

         QDateTime dt;
         dt.setTime_t((time_t) tm);

         separ++;
         int level = 1;
         if (*separ=='2') level=2; else
         if (*separ=='3') level=3;

         AddMessage(dt, level, separ+2);
      }
   } else
   if (obj!=0) {
      AddMessage(QDateTime::currentDateTime(), 0, obj->GetName());
   }
}
開發者ID:svn2github,項目名稱:Go4,代碼行數:32,代碼來源:TGo4LogInfo.cpp

示例10: sizeof

void
CExampleDlg::OnBnClickedConnectButton()
{
	WCHAR awcTempBuf[100];
	const int kTempBufSize = sizeof(awcTempBuf) / sizeof(awcTempBuf[0]);

	// Pull user input into our member variables
	UpdateData(TRUE);

	// Clear out the results list, in case this isn't the first time
	// we've come in here.
	ResultsList.ResetContent();

	// Translate the Unicode text we get from the UI into the UTF-8 form
	// that MySQL wants.
	const int kInputBufSize = 100;
	char acServerAddress[kInputBufSize];
	char acUserName[kInputBufSize];
	char acPassword[kInputBufSize];
	ToUTF8(acServerAddress, kInputBufSize, sServerAddress);
	ToUTF8(acUserName, kInputBufSize, sUserName);
	ToUTF8(acPassword, kInputBufSize, sPassword);

	// Connect to the sample database.
	mysqlpp::Connection con(false);
	if (!con.connect("mysql_cpp_data", acServerAddress, acUserName,
			acPassword)) {
		AddMessage(_T("Failed to connect to server:"));
		if (ToUCS2(awcTempBuf, kTempBufSize, con.error())) {
			AddMessage(awcTempBuf);
		}
		return;
	}

	// Retrieve a subset of the sample stock table set up by resetdb
	mysqlpp::Query query = con.query();
	query << "select item from stock";
	mysqlpp::StoreQueryResult res = query.store();

	if (res) {
		// Display the result set
		for (size_t i = 0; i < res.num_rows(); ++i) {
			if (ToUCS2(awcTempBuf, kTempBufSize, res[i][0])) {
				AddMessage(awcTempBuf);
			}
		}

		// Retreive was successful, so save user inputs now
		SaveInputs();
	}
	else {
		// Retreive failed
		AddMessage(_T("Failed to get item list:"));
		if (ToUCS2(awcTempBuf, kTempBufSize, query.error())) {
			AddMessage(awcTempBuf);
		}
	}
}
開發者ID:RavenX8,項目名稱:mysqlpp,代碼行數:58,代碼來源:mfc_dlg.cpp

示例11: cudaEventRecord

NVENCSTATUS NVEncFilter::filter(FrameInfo *pInputFrame, FrameInfo **ppOutputFrames, int *pOutputFrameNum) {
    cudaError_t cudaerr = cudaSuccess;
    if (m_bCheckPerformance) {
        cudaerr = cudaEventRecord(*m_peFilterStart.get());
        if (cudaerr != cudaSuccess) {
            AddMessage(RGY_LOG_ERROR, _T("failed cudaEventRecord(m_peFilterStart): %s.\n"), char_to_tstring(cudaGetErrorString(cudaerr)).c_str());
        }
    }

    if (pInputFrame == nullptr) {
        *pOutputFrameNum = 0;
        ppOutputFrames[0] = nullptr;
    }
    if (m_pParam
        && m_pParam->bOutOverwrite //上書きか?
        && pInputFrame != nullptr && pInputFrame->ptr != nullptr //入力が存在するか?
        && ppOutputFrames != nullptr && ppOutputFrames[0] == nullptr) { //出力先がセット可能か?
        ppOutputFrames[0] = pInputFrame;
        *pOutputFrameNum = 1;
    }
    const auto ret = run_filter(pInputFrame, ppOutputFrames, pOutputFrameNum);
    const int nOutFrame = *pOutputFrameNum;
    if (!m_pParam->bOutOverwrite && nOutFrame > 0) {
        if (m_nPathThrough & FILTER_PATHTHROUGH_TIMESTAMP) {
            if (nOutFrame != 1) {
                AddMessage(RGY_LOG_ERROR, _T("timestamp path through can only be applied to 1-in/1-out filter.\n"));
                return NV_ENC_ERR_INVALID_CALL;
            } else {
                ppOutputFrames[0]->timestamp = pInputFrame->timestamp;
                ppOutputFrames[0]->duration  = pInputFrame->duration;
            }
        }
        for (int i = 0; i < nOutFrame; i++) {
            if (m_nPathThrough & FILTER_PATHTHROUGH_FLAGS)     ppOutputFrames[i]->flags     = pInputFrame->flags;
            if (m_nPathThrough & FILTER_PATHTHROUGH_PICSTRUCT) ppOutputFrames[i]->picstruct = pInputFrame->picstruct;
        }
    }
    if (m_bCheckPerformance) {
        cudaerr = cudaEventRecord(*m_peFilterFin.get());
        if (cudaerr != cudaSuccess) {
            AddMessage(RGY_LOG_ERROR, _T("failed cudaEventRecord(m_peFilterFin): %s.\n"), char_to_tstring(cudaGetErrorString(cudaerr)).c_str());
        }
        cudaerr = cudaEventSynchronize(*m_peFilterFin.get());
        if (cudaerr != cudaSuccess) {
            AddMessage(RGY_LOG_ERROR, _T("failed cudaEventSynchronize(m_peFilterFin): %s.\n"), char_to_tstring(cudaGetErrorString(cudaerr)).c_str());
        }
        float time_ms = 0.0f;
        cudaerr = cudaEventElapsedTime(&time_ms, *m_peFilterStart.get(), *m_peFilterFin.get());
        if (cudaerr != cudaSuccess) {
            AddMessage(RGY_LOG_ERROR, _T("failed cudaEventElapsedTime(m_peFilterStart - m_peFilterFin): %s.\n"), char_to_tstring(cudaGetErrorString(cudaerr)).c_str());
        }
        m_dFilterTimeMs += time_ms;
        m_nFilterRunCount++;
    }
    return ret;
}
開發者ID:ming-hai,項目名稱:NVEnc,代碼行數:56,代碼來源:NVEncFilter.cpp

示例12: Logic_error

IndexException::IndexException(int i, const GeneralMatrix& A, bool)
   : Logic_error()
{
   Select = Exception::Select;
   AddMessage("detected by Newmat: element error: requested index (wrt 0) = ");
   AddInt(i);
   AddMessage("\n\n");
   MatrixDetails(A);
   Tracer::AddTrace();
}
開發者ID:DX94,項目名稱:Enigma-Studio-3,代碼行數:10,代碼來源:newmatex.cpp

示例13: OnStartBatch

	void	OnStartBatch( void ){
		m_btnStart.Enable( FALSE );

		AddMessage(_T("---- start a new batch ----"));

		SubmitThreadpoolWork( m_pWorkItem );
		SubmitThreadpoolWork( m_pWorkItem );
		SubmitThreadpoolWork( m_pWorkItem );
		SubmitThreadpoolWork( m_pWorkItem );

		AddMessage(_T("4 tasks are submitted."));
	}
開發者ID:H2-T23,項目名稱:garage,代碼行數:12,代碼來源:11Batch.cpp

示例14: AddMessage

    Exception::Exception(const char* a_what) {
	Select++; SoFar = 0;
	if (!what_error) {                            // make space for exception message
	    LastOne = 511;
	    what_error = new char[512];
	    if (!what_error) {                          // fail to make space
		LastOne = 0;
		what_error = "No heap space for exception message\n";
	    }
	}
	AddMessage("\n\nAn exception has been thrown\n");
	AddMessage(a_what);
	if (a_what) Tracer::AddTrace();
    }
開發者ID:ndilday,項目名稱:virtualu,代碼行數:14,代碼來源:Myexcept.cpp

示例15: SendAffects

void SendAffects(int clientId) // 7.54
{
	if(clientId > PLAYER)
		return;

	p754_GetAffect pack_3B9 = *(p754_GetAffect*)malloc(sizeof(p754_GetAffect)); 

	pack_3B9.Header.PacketId = 0x3B9;
	pack_3B9.Header.Size = 140;
	pack_3B9.Header.ClientID = clientId;
	int addr_base = clientId * 0x0410;

	st_Mob_754 *_mob = (st_Mob_754*)GetMobFromIndex(clientId);

	for(short i = 0; i < 16 && _mob != NULL; i++)
	{
		if(mobaffectbuffer[clientId].Affects[i].Time != 0)
		{
			pack_3B9.Affect[i + 1].Index = (BYTE)mobaffectbuffer[clientId].Affects[i].Index;
			pack_3B9.Affect[i + 1].Master = (BYTE)mobaffectbuffer[clientId].Affects[i].Master;
			pack_3B9.Affect[i + 1].Value = mobaffectbuffer[clientId].Affects[i].Value;
			pack_3B9.Affect[i + 1].Time = mobaffectbuffer[clientId].Affects[i].Time;
		}
		
	}
	

	//AddMessage((BYTE*)&pack_3B9, clientId);
	AddMessage(clientId, (char*)&pack_3B9, 128);

	return;
}
開發者ID:reon,項目名稱:GnsWydServer,代碼行數:32,代碼來源:SendAffect.cpp


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