这篇教程C++ BOOL函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOL函数的具体用法?C++ BOOL怎么用?C++ BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BOOL函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SJ_ToggleFullScreen//-----------------------------------------------------------------------------// Changes presentation parameters for windowed or fullscreen//-----------------------------------------------------------------------------void SJ_ToggleFullScreen( ){ g_fullScreen = ! g_fullScreen; ZeroMemory( &g_d3dpp, sizeof( g_d3dpp ) ); g_d3dpp.Windowed = !g_fullScreen; g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; g_d3dpp.EnableAutoDepthStencil = TRUE; g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; GetClientRect( g_hWnd, &g_clRect ); if ( g_fullScreen ) { g_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; g_d3dpp.FullScreen_RefreshRateInHz = 0; g_d3dpp.BackBufferWidth = SCREEN_WIDTH; g_d3dpp.BackBufferHeight = SCREEN_HEIGHT; g_clRect.right = SCREEN_WIDTH; g_clRect.bottom = SCREEN_HEIGHT; SetCursor( NULL ); } ShowCursor( BOOL(!g_fullScreen) ); if ( g_pd3dDevice != NULL ) g_pd3dDevice->ShowCursor( BOOL(!g_fullScreen) );}
开发者ID:gyakoo,项目名称:superjumper,代码行数:28,
示例2: ApplyAERBOOL vmsTpDownloadMgr::CheckDstFileExists(){ if (DWORD (-1) != GetFileAttributes (m_info.strOutputPath + m_info.strFileName)) { fsAlreadyExistReaction enAER = m_enAER; BOOL bRet = ApplyAER (enAER); if (bRet == FALSE) { RaiseEvent (DE_EXTERROR, DMEE_FATALERROR); return FALSE; } else if (bRet == BOOL (-1)) return FALSE; else if (bRet == BOOL (2)) SetToRestartState (); RaiseEvent (LS (L_OPENINGFILE)); m_dldr->InitTpStream(m_info.strTorrentUrl, m_info.strOutputPath + m_info.strFileName, GetStreamingSpeed ()); RaiseEvent (LS (L_SUCCESS), EDT_RESPONSE_S); } return TRUE;}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:25,
示例3: icon_list_newstatic GtkWidget *icon_list_new (GladeXML *xml, GType widget_type, GladeWidgetInfo *info){ GtkWidget *gil; int flags = 0; int icon_width = 0; int i; for (i = 0; i < info->n_properties; i++) { const char *name = info->properties[i].name; const char *value = info->properties[i].value; if (!strcmp (name, "text_editable")) { if (BOOL (value)) flags |= MATE_ICON_LIST_IS_EDITABLE; } else if (!strcmp (name, "text_static")) { if (BOOL (value)) flags |= MATE_ICON_LIST_STATIC_TEXT; } else if (!strcmp (name, "icon_width")) { icon_width = INT (value); } } gil = glade_standard_build_widget (xml, widget_type, info); mate_icon_list_construct (MATE_ICON_LIST (gil), icon_width, NULL, flags); return gil;}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:31,
示例4: s_TEST_WinSystemDllstatic void s_TEST_WinSystemDll(void){#if defined NCBI_OS_MSWIN CDll dll_user32("USER32", CDll::eLoadLater); CDll dll_userenv("userenv.dll", CDll::eLoadNow, CDll::eAutoUnload); // Load DLL dll_user32.Load(); // DLL functions definition BOOL (STDMETHODCALLTYPE FAR * dllMessageBeep) (UINT type) = NULL; BOOL (STDMETHODCALLTYPE FAR * dllGetProfilesDirectory) (LPTSTR lpProfilesDir, LPDWORD lpcchSize) = NULL; // This is other variant of functions definition // // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNMESSAGEBEEP) ( // UINT uType // ); // LPFNMESSAGEBEEP dllMessageBeep = NULL; // // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNGETPROFILESDIR) ( // LPTSTR lpProfilesDir, // LPDWORD lpcchSize // ); // LPFNGETUSERPROFILESDIR dllGetProfilesDirectory = NULL; dllMessageBeep = dll_user32.GetEntryPoint_Func("MessageBeep", &dllMessageBeep ); if ( !dllMessageBeep ) { ERR_FATAL("Error get address of function MessageBeep()."); } // Call loaded function dllMessageBeep(-1); #ifdef UNICODE dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryW", &dllGetProfilesDirectory); #else dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryA", &dllGetProfilesDirectory); #endif if ( !dllGetProfilesDirectory ) { ERR_FATAL("Error get address of function GetUserProfileDirectory()."); } // Call loaded function TCHAR szProfilePath[1024]; DWORD cchPath = 1024; if ( dllGetProfilesDirectory(szProfilePath, &cchPath) ) { cout << "Profile dir: " << szProfilePath << endl; } else { ERR_FATAL("GetProfilesDirectory() failed"); } // Unload USER32.DLL (our work copy) dll_user32.Unload(); // USERENV.DLL will be unloaded in the destructor // dll_userenv.Unload();#endif}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:59,
示例5: test_cryptTlsstatic void test_cryptTls(void){ DWORD (WINAPI *pI_CryptAllocTls)(void); LPVOID (WINAPI *pI_CryptDetachTls)(DWORD dwTlsIndex); LPVOID (WINAPI *pI_CryptGetTls)(DWORD dwTlsIndex); BOOL (WINAPI *pI_CryptSetTls)(DWORD dwTlsIndex, LPVOID lpTlsValue); BOOL (WINAPI *pI_CryptFreeTls)(DWORD dwTlsIndex, DWORD unknown); DWORD index; BOOL ret; pI_CryptAllocTls = (void *)GetProcAddress(hCrypt, "I_CryptAllocTls"); pI_CryptDetachTls = (void *)GetProcAddress(hCrypt, "I_CryptDetachTls"); pI_CryptGetTls = (void *)GetProcAddress(hCrypt, "I_CryptGetTls"); pI_CryptSetTls = (void *)GetProcAddress(hCrypt, "I_CryptSetTls"); pI_CryptFreeTls = (void *)GetProcAddress(hCrypt, "I_CryptFreeTls"); /* One normal pass */ index = pI_CryptAllocTls(); ok(index, "I_CryptAllocTls failed: %08x/n", GetLastError()); if (index) { LPVOID ptr; ptr = pI_CryptGetTls(index); ok(!ptr, "Expected NULL/n"); ret = pI_CryptSetTls(index, (LPVOID)0xdeadbeef); ok(ret, "I_CryptSetTls failed: %08x/n", GetLastError()); ptr = pI_CryptGetTls(index); ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p/n", ptr); /* This crashes ret = pI_CryptFreeTls(index, 1); */ ret = pI_CryptFreeTls(index, 0); ok(ret, "I_CryptFreeTls failed: %08x/n", GetLastError()); ret = pI_CryptFreeTls(index, 0); ok(!ret, "I_CryptFreeTls succeeded/n"); ok(GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x/n", GetLastError()); } /* Similar pass, check I_CryptDetachTls */ index = pI_CryptAllocTls(); ok(index, "I_CryptAllocTls failed: %08x/n", GetLastError()); if (index) { LPVOID ptr; ptr = pI_CryptGetTls(index); ok(!ptr, "Expected NULL/n"); ret = pI_CryptSetTls(index, (LPVOID)0xdeadbeef); ok(ret, "I_CryptSetTls failed: %08x/n", GetLastError()); ptr = pI_CryptGetTls(index); ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p/n", ptr); ptr = pI_CryptDetachTls(index); ok(ptr == (LPVOID)0xdeadbeef, "Expected 0xdeadbeef, got %p/n", ptr); ptr = pI_CryptGetTls(index); ok(!ptr, "Expected NULL/n"); }}
开发者ID:hoangduit,项目名称:reactos,代码行数:58,
示例6: sdl_getMouseStatestatic VALUE sdl_getMouseState(VALUE mod){ int x,y; Uint8 result; result=SDL_GetMouseState(&x,&y); return rb_ary_new3(5,INT2FIX(x),INT2FIX(y),BOOL(result&SDL_BUTTON_LMASK), BOOL(result&SDL_BUTTON_MMASK), BOOL(result&SDL_BUTTON_RMASK));}
开发者ID:alokmenghrajani,项目名称:alokmenghrajani.github.com,代码行数:9,
示例7: ValidateRDescvoid dx10StateManager::SetMultisample(u32 Enable){ ValidateRDesc(); if (m_RDesc.MultisampleEnable!=BOOL(Enable)) { m_bRSChanged = true; m_RDesc.MultisampleEnable=BOOL(Enable); }}
开发者ID:2asoft,项目名称:xray-16,代码行数:10,
示例8: setInfoToSMPEGInfostatic void setInfoToSMPEGInfo(VALUE obj,SMPEG_Info info){ rb_iv_set(obj,"@has_audio",BOOL(info.has_audio)); rb_iv_set(obj,"@has_video",BOOL(info.has_video)); rb_iv_set(obj,"@width",INT2NUM(info.width)); rb_iv_set(obj,"@height",INT2NUM(info.height)); rb_iv_set(obj,"@current_frame",INT2NUM(info.current_frame)); rb_iv_set(obj,"@current_fps",INT2NUM(info.current_fps)); rb_iv_set(obj,"@audio_string",rb_str_new2(info.audio_string)); rb_iv_set(obj,"@audio_current_frame",INT2NUM(info.audio_current_frame)); rb_iv_set(obj,"@current_offset",UINT2NUM(info.current_offset)); rb_iv_set(obj,"@total_size",UINT2NUM(info.total_size)); rb_iv_set(obj,"@current_time",UINT2NUM(info.current_time)); rb_iv_set(obj,"@total_time",UINT2NUM(info.total_time));}
开发者ID:alokmenghrajani,项目名称:alokmenghrajani.github.com,代码行数:15,
示例9: _Tbool CI8DeskSvr::StartRemoteControl(){ stdex::tString strFilePath = utility::GetAppPath() + _T("WinVNC//"); SetDllDirectory(strFilePath.c_str()); strFilePath += TEXT("WinVNC.dll"); m_hRemoteCtrl = LoadLibrary(strFilePath.c_str()); if (m_hRemoteCtrl == NULL) return false; typedef BOOL (WINAPI* PFNSTARTVNC)(); PFNSTARTVNC pfnStartVNC = GetProcAddress(m_hRemoteCtrl, "[email C++ BOOLSETTING函数代码示例 C++ BODY函数代码示例
|