本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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;
}
示例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();
};
示例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);
}
示例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("串口关闭成功");
}
}
示例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();
}
示例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());
}
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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."));
}
示例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();
}
示例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;
}