• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddMessage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetMessageContact

void MessagesDlg::OnEnMsgfilterMessage(NMHDR *pNMHDR, LRESULT *pResult)
{
	MSGFILTER *pMsgFilter = reinterpret_cast<MSGFILTER *>(pNMHDR);

	if (pMsgFilter->msg == WM_CHAR) {
		if ( pMsgFilter->wParam == VK_RETURN ) {
			CRichEditCtrl* richEdit = (CRichEditCtrl*)GetDlgItem(IDC_MESSAGE);
			CString message;
			int len = richEdit->GetWindowTextLength();
			LPTSTR ptr = message.GetBuffer(len);
			richEdit->GetWindowText(ptr,len+1);
			message.ReleaseBuffer();
			message.Trim();
			if (message.GetLength()) {
				MessagesContact* messagesContact = GetMessageContact();
				if (SendMessage (messagesContact,message) ) {
					richEdit->SetWindowText(NULL);
					GotoDlgCtrl(richEdit);
					AddMessage(messagesContact, message, MSIP_MESSAGE_TYPE_LOCAL);
				}
			}
			*pResult= 1;
			return;
		}
	}
	*pResult = 0;
}
开发者ID:cookie114,项目名称:PerforceRoot_Lupc,代码行数:27,代码来源:MessagesDlg.cpp


示例17: CreateGroup

int CreateGroup(const TCHAR *group, MCONTACT hContact)
{
	if (group == NULL)
		return 0;

	size_t cbName = mir_tstrlen(group);
	TCHAR *tszGrpName = (TCHAR*)_alloca((cbName + 2)*sizeof(TCHAR));
	tszGrpName[0] = 1 | GROUPF_EXPANDED;
	mir_tstrcpy(tszGrpName + 1, group);

	// Check for duplicate & find unused id
	char groupIdStr[11];
	for (int groupId = 0;; groupId++) {
		itoa(groupId, groupIdStr, 10);
		ptrT tszDbGroup(db_get_tsa(NULL, "CListGroups", groupIdStr));
		if (tszDbGroup == NULL)
			break;

		if (!mir_tstrcmp((TCHAR*)tszDbGroup+1, tszGrpName+1)) {
			if (hContact)
				db_set_ts(hContact, "CList", "Group", tszGrpName + 1);
			else
				AddMessage(LPGENT("Skipping duplicate group %s."), tszGrpName + 1);
			return 0;
		}
	}

	db_set_ts(NULL, "CListGroups", groupIdStr, tszGrpName);

	if (hContact)
		db_set_ts(hContact, "CList", "Group", tszGrpName + 1);

	return 1;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:34,代码来源:utils.cpp


示例18: TaskHandler

	void	TaskHandler( void ){
		LONG	currentTask	= InterlockedIncrement( &m_nCurrentTask );

		TString	str;
		str.Format(_T("[%u] Task #%u is starting."), GetCurrentThreadId(), currentTask);
		AddMessage( (LPCTSTR)str );

		Sleep( currentTask * 1000 );

		str.Format(_T("[%u] Task #%u is done."), GetCurrentThreadId(), currentTask);
		AddMessage( (LPCTSTR)str );

		if( InterlockedDecrement(&m_nCurrentTask) == 0 ){
			PostMessage( WM_APP_COMPLETED, 0, (LPARAM)currentTask );
		}
	}
开发者ID:H2-T23,项目名称:garage,代码行数:16,代码来源:11Batch.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddNode函数代码示例发布时间:2022-05-30
下一篇:
C++ AddMenuItem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap