本文整理汇总了C++中Host::IsDebugMode方法的典型用法代码示例。如果您正苦于以下问题:C++ Host::IsDebugMode方法的具体用法?C++ Host::IsDebugMode怎么用?C++ Host::IsDebugMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host::IsDebugMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
HRESULT STDMETHODCALLTYPE
Win32WebKitUIDelegate::trackCustomPopupMenu(
/* [in] */ IWebView *sender,
/* [in] */ OLE_HANDLE inMenu,
/* [in] */ LPPOINT point)
{
AutoPtr<Win32Menu> menu = this->window->GetContextMenu().cast<Win32Menu>();
// No window menu, try to use the application menu.
if (menu.isNull())
{
Win32UIBinding* b = static_cast<Win32UIBinding*>(UIBinding::GetInstance());
menu = b->GetContextMenu().cast<Win32Menu>();
}
if (this->nativeContextMenu) {
DestroyMenu(this->nativeContextMenu);
this->nativeContextMenu = 0;
}
Host* host = Host::GetInstance();
if (!menu.isNull()) {
this->nativeContextMenu = menu->CreateNative(false);
} else if (host->IsDebugMode()) {
this->nativeContextMenu = CreatePopupMenu();
Win32Menu::ApplyNotifyByPositionStyleToNativeMenu(this->nativeContextMenu);
}
if (this->nativeContextMenu) {
if (host->IsDebugMode()) {
AppendMenu(this->nativeContextMenu, MF_SEPARATOR, 1, L"Separator");
AppendMenu(this->nativeContextMenu,
MF_STRING, WEB_INSPECTOR_MENU_ITEM_ID, L"Show Inspector");
}
TrackPopupMenu(this->nativeContextMenu,
TPM_BOTTOMALIGN, point->x, point->y, 0,
this->window->GetWindowHandle(), NULL);
}
return S_OK;
}
示例2: Execute
int Execute(HINSTANCE hInstance, int argc, const char **argv){
Host *host = new kroll::Win32Host(hInstance,argc,argv);
#ifndef DEBUG
// only create a debug console when not compiled in debug mode -- otherwise, it should be autocreated
if (host->IsDebugMode())
{
RedirectIOToConsole();
}
#endif
return host->Run();
}