当前位置: 首页>>代码示例>>C++>>正文


C++ BOOL函数代码示例

本文整理汇总了C++中BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOL函数的具体用法?C++ BOOL怎么用?C++ BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BOOL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:GfxOs.cpp

示例2: ApplyAER

BOOL 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,代码来源:vmsTpDownloadMgr.cpp

示例3: icon_list_new

static 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,代码来源:glade-mate.c

示例4: s_TEST_WinSystemDll

static 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,代码来源:test_ncbidll.cpp

示例5: test_cryptTls

static 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,代码来源:main.c

示例6: sdl_getMouseState

static 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,代码来源:rubysdl_mouse.c

示例7: ValidateRDesc

void dx10StateManager::SetMultisample(u32 Enable)
{
	ValidateRDesc();

	if (m_RDesc.MultisampleEnable!=BOOL(Enable))
	{
		m_bRSChanged = true;
		m_RDesc.MultisampleEnable=BOOL(Enable);
	}
}
开发者ID:2asoft,项目名称:xray-16,代码行数:10,代码来源:dx10StateManager.cpp

示例8: setInfoToSMPEGInfo

static 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,代码来源:rubysdl_smpeg.c

示例9: _T

bool 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 protected]");
	if (pfnStartVNC == NULL)
		return false;

	try
	{
		pfnStartVNC(); 
	}
	catch(...)
	{
		m_pLogger->WriteLog(LM_INFO, TEXT("加载远程控制客户端失败。\r\n"));
		BOOL (WINAPI* pfnStopVNC)();
		pfnStopVNC = GetProcAddress(m_hRemoteCtrl, "[email protected]");
		if (pfnStopVNC == NULL)
			return false;

		pfnStopVNC(); 
	}

	m_pLogger->WriteLog(LM_INFO, TEXT("加载远程控制客户端成功。\r\n"));
	return true;
}
开发者ID:lubing521,项目名称:important-files,代码行数:33,代码来源:I8DeskSvr.cpp

示例10: fclose

S32 LLXfer_File::startDownload()
{
 	S32 retval = 0;  // presume success
	mFp = LLFile::fopen(mTempFilename,"w+b");		/* Flawfinder : ignore */
	if (mFp)
	{
		fclose(mFp);
		mFp = NULL;

		gMessageSystem->newMessageFast(_PREHASH_RequestXfer);
		gMessageSystem->nextBlockFast(_PREHASH_XferID);
		gMessageSystem->addU64Fast(_PREHASH_ID, mID);
		gMessageSystem->addStringFast(_PREHASH_Filename, mRemoteFilename);
		gMessageSystem->addU8("FilePath", (U8) mRemotePath);
		gMessageSystem->addBOOL("DeleteOnCompletion", mDeleteRemoteOnCompletion);
		gMessageSystem->addBOOL("UseBigPackets", BOOL(mChunkSize == LL_XFER_LARGE_PAYLOAD));
		gMessageSystem->addUUIDFast(_PREHASH_VFileID, LLUUID::null);
		gMessageSystem->addS16Fast(_PREHASH_VFileType, -1);
	
		gMessageSystem->sendReliable(mRemoteHost);		
		mStatus = e_LL_XFER_IN_PROGRESS;
	}
	else
	{
		LL_WARNS() << "Couldn't create file to be received!" << LL_ENDL;
		retval = -1;
	}

	return (retval);
}
开发者ID:AlchemyDev,项目名称:Carbon,代码行数:30,代码来源:llxfer_file.cpp

示例11: dpb

// static
void LLKeyTool::onTransferInfo(LLMessageSystem *msg, void **user_data)
{
	S32 params_size = msg->getSize(_PREHASH_TransferInfo, _PREHASH_Params);
	if(params_size < 1) return;
	U8 tmp[1024];
	msg->getBinaryDataFast(_PREHASH_TransferInfo, _PREHASH_Params, tmp, params_size);
	LLDataPackerBinaryBuffer dpb(tmp, 1024);
	LLUUID asset_id;
	dpb.unpackUUID(asset_id, "AssetID");
	S32 asset_type;
	dpb.unpackS32(asset_type, "AssetType");
	S32 status;
	msg->getS32Fast(_PREHASH_TransferInfo, _PREHASH_Status, status, 0);

	BOOL wanted = callback(asset_id, KT_ASSET, (LLAssetType::EType)asset_type, BOOL(status == 0)); // LLTS_OK (e_status_codes)
	if(wanted)
	{
		LLKeyTool::sTransferRequests--;
		if(LLKeyTool::sTransferRequests <= 0)
		{
			LLKeyTool::sTransferRequests = 0;
			gMessageSystem->delHandlerFuncFast(_PREHASH_TransferInfo, &onTransferInfo);
		}
	}
}
开发者ID:fractured-crystal,项目名称:SssnowGlobeeE,代码行数:26,代码来源:llkeytool.cpp

示例12: SetAlpha

SetAlpha(LONG nTrans) {
  HMODULE hDllUser32 = LoadLibrary("user32");
  if (hDllUser32) {
    BOOL (WINAPI *pfnSetLayeredWindowAttributes)(HWND,DWORD,BYTE,DWORD);

    pfnSetLayeredWindowAttributes
      = (BOOL (WINAPI *)(HWND,DWORD,BYTE,DWORD))
          GetProcAddress(hDllUser32, "SetLayeredWindowAttributes");

    if (pfnSetLayeredWindowAttributes) {
      HWND hTop = GetVimWindow();
      if (hTop) {
        if (nTrans == 255) {
          SetWindowLong(hTop, GWL_EXSTYLE,
          GetWindowLong(hTop, GWL_EXSTYLE) & ~WS_EX_LAYERED); 
        } else {
          SetWindowLong(hTop, GWL_EXSTYLE,
          GetWindowLong(hTop, GWL_EXSTYLE) | WS_EX_LAYERED); 
          pfnSetLayeredWindowAttributes(hTop, 0, (BYTE)nTrans, LWA_ALPHA);
        }
      }
    }
    FreeLibrary(hDllUser32);
  }
  return GetLastError();
}
开发者ID:madwenoma,项目名称:vimtweak,代码行数:26,代码来源:vimtweak.c

示例13: BOOL

CAygshellHelper::CAygshellHelper( void )
{
    if( m_hAygshellDLL = LoadLibrary( L"aygshell.dll" ) )
    {
        BOOL (*SHInitExtraControls)() = NULL;
        SHInitExtraControls = (BOOL (*)())GetProcAddress( m_hAygshellDLL, L"SHInitExtraControls" );
        SHInitDialog = (LPSHINITDIALOG)GetProcAddress( m_hAygshellDLL, L"SHInitDialog" );
        SHInputDialog = (LPSHINPUTDIALOG)GetProcAddress( m_hAygshellDLL, L"SHInputDialog" );
        SHSipInfo = (LPSHSIPINFO)GetProcAddress( m_hAygshellDLL, L"SHSipInfo" );
        // SHHandleWMSettingChange isn't exported by name, so reference its ordinal.
        // OEMs shouldn't have to do this since they won't conditionally include aygshell.
        SHHandleWMSettingChange = (LPSHHANDLEWMSETTINGCHANGE)GetProcAddress( m_hAygshellDLL, (LPWSTR)MAKELONG(83, 0) );
        if( !(SHInitDialog && SHInputDialog
        	&& SHInitExtraControls && SHSipInfo
        	&& SHHandleWMSettingChange) )
        {
            FreeLibrary( m_hAygshellDLL );
            m_hAygshellDLL = NULL;
        }
        else
        {
            SHInitExtraControls();
        }
    }
}
开发者ID:nocoolnicksleft,项目名称:DingDong600,代码行数:25,代码来源:aygshell_helper.cpp

示例14: list_tasks_worker

int
list_tasks_worker(worker_t * worker, GError ** error)
{
	struct bulk_s {
		char id[MAX_TASKID_LENGTH];
		gint64 period;
		guint8 busy;
		// used to compute the length of the structure without padding, with
		// the help of offsetof().
		gchar last[];
	} bulk;
	GHashTableIter iter;
	gpointer k, v;

	GByteArray *gba = g_byte_array_new();
	g_hash_table_iter_init(&iter, tasks);
	while (g_hash_table_iter_next(&iter, &k, &v)) {
		task_t *t;
		if (!(t = v))
			continue;
		memset(&bulk, 0, sizeof(bulk));
		g_strlcpy(bulk.id, t->id, sizeof(bulk.id));
		bulk.period = t->period;
		bulk.busy = BOOL(t->busy);
		g_byte_array_append(gba, (guint8*)&bulk, offsetof(struct bulk_s, last));
	}

	return __respond(worker, 1, gba, error);
}
开发者ID:Narthorn,项目名称:oio-sds,代码行数:29,代码来源:task_scheduler.c

示例15: AssertFatal

void 
GWControlProxy::setEnable(const bool in_enable) const
{
   AssertFatal(m_attached == true, "Error, not attached...");
   
   EnableWindow(m_ctrlHWnd, BOOL(in_enable));
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:7,代码来源:gwControlProxy.cpp


注:本文中的BOOL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。