本文整理汇总了C++中MessageBox::sendMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageBox::sendMessage方法的具体用法?C++ MessageBox::sendMessage怎么用?C++ MessageBox::sendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBox
的用法示例。
在下文中一共展示了MessageBox::sendMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]){
try {
if (argc < 2) usage();
char *ocfacaseenv=getenv("OCFACASE");
if (ocfacaseenv == 0){
setenv("OCFACASE", argv[1], 1);
}
else {
if (strcmp(ocfacaseenv, argv[1])){
cerr << "ERROR: The OCFACASE enviroment variable is set to '" << ocfacaseenv << "' while the case specified is '" << argv[1] << "\n";
return 1;
}
}
MessageBox *box = MessageBox::createInstance("ocfarecover", "admin");
OcfaConfig::Instance()->baptize(box->getModuleInstance());
OcfaLogger::Instance()->baptize(box->getModuleInstance());
if (box == 0){
cerr << "cannot initialize messagebox" << endl;
} else {
Message *message = 0;
ocfa::misc::ModuleInstance receiver("all", "all", "all", "all");
// TODO set priority.
cerr << "Messagetype is " << Message::mtRecover << endl;
box->createMessage(&message, 0, Message::BROADCAST, Message::mtRecover, "subject", "blahbalh", 0);
cerr << "Message->getType() is " << message->getType() << endl;
box->sendMessage(*message);
cerr << "message sent" << endl;
delete box;
}
} catch(ocfa::misc::OcfaException e){
cerr << "Exception" << e.what() << endl;
}
}