本文整理汇总了C++中TString::GetAsWChar方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::GetAsWChar方法的具体用法?C++ TString::GetAsWChar怎么用?C++ TString::GetAsWChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::GetAsWChar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static enum v7_err jsBotLoadFile(struct v7* v7, v7_val_t* res) {
v7_val_t file = v7_arg(v7, 0);
if (!v7_is_string(file)) {
return V7_OK;
}
TString fullPath = _activeBot->getWorkDir();
TString fileName = v7_to_cstring(v7, &file);
fullPath += fileName.GetAsWChar();
if (!fexists(fullPath)) {
return V7_OK;
}
v7_val_t result;
enum v7_err ress = V7_OK;
ress = v7_exec_file(v7, fullPath.GetAsChar(), &result);
//v7_val_t* v7Obj = _activeBot->getV7Obj();
//*v7Obj = v7_mk_object(v7);
if (ress != V7_OK) {
if (result == V7_SYNTAX_ERROR) MessageBox(NULL, "script fail syntax error", "Nooo", 0);
else if (result == V7_EXEC_EXCEPTION) MessageBox(NULL, "script fail, exception", "Nooo", 0);
else if (result == V7_EXEC_EXCEPTION) MessageBox(NULL, "script fail, exception", "Nooo", 0);
else if (result == V7_AST_TOO_LARGE) MessageBox(NULL, "script fail, ast too large", "Nooo", 0);
}
return V7_OK;
}
示例2: say
void Bot::say(TString& text, TString& font, unsigned char fontSize, TString& color) {
if (font.IsEQ(L"")) font = _charset.font;
if (fontSize < 10) fontSize = _charset.size;
COLORREF coll = _charset.color;
if (!color.IsEQ(L"")) coll = GetCol(color.GetAsWChar());
bot_exchange_format p(PLUGIN_EVENT_ROOM_TEXT);
p << bot_value(1, text.GetAsChar());
p << bot_value(2, _charset.attributes);
p << bot_value(3, fontSize);
p << bot_value(4, coll);
p << bot_value(5, _charset.effect);
p << bot_value(6, _charset.charset);
p << bot_value(7, _charset.pitch);
p << bot_value(8, font.GetAsChar());
std::string d = p.data();
_mgr->deliver_event(_name.GetAsChar(), d.c_str(), (int)d.size());
}