本文整理汇总了C++中V_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ V_BOOL函数的具体用法?C++ V_BOOL怎么用?C++ V_BOOL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了V_BOOL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SysAllocString
STDMETHODIMP XcpPropertyBag::Read(LPCOLESTR pszPropName, VARIANT *pVar, IErrorLog *pErrorLog)
{
HRESULT hr = E_INVALIDARG;
BSTR bstrValue = NULL;
if (_wcsicmp(pszPropName, L"Source") == 0)
{
bstrValue = SysAllocString(L"SilverlightBalls.xap");
}
else if (_wcsicmp(pszPropName, L"Background") == 0)
{
bstrValue = SysAllocString(L"Transparent");
}
else if (_wcsicmp(pszPropName, L"EnableGPUAcceleration") == 0)
{
V_VT(pVar) = VT_BOOL;
V_BOOL(pVar) = VARIANT_TRUE;
hr = S_OK;
}
else if (_wcsicmp(pszPropName, L"Windowless") == 0)
{
V_VT(pVar) = VT_BOOL;
V_BOOL(pVar) = VARIANT_FALSE;
hr = S_OK;
}
if (bstrValue != NULL)
{
V_VT(pVar) = VT_BSTR;
V_BSTR(pVar) = bstrValue;
hr = S_OK;
}
return hr;
}
示例2: ClDispatch_Invoke
static HRESULT WINAPI ClDispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
DocHost *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%s %s %d %04x %p %p %p %p)\n", This, debugstr_dispid(dispIdMember),
debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
switch(dispIdMember) {
case DISPID_AMBIENT_USERMODE:
case DISPID_AMBIENT_DLCONTROL:
case DISPID_AMBIENT_USERAGENT:
case DISPID_AMBIENT_PALETTE:
if(!This->client_disp)
return E_FAIL;
return IDispatch_Invoke(This->client_disp, dispIdMember, riid, lcid, wFlags,
pDispParams, pVarResult, pExcepInfo, puArgErr);
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
V_VT(pVarResult) = VT_BOOL;
V_BOOL(pVarResult) = This->offline;
return S_OK;
case DISPID_AMBIENT_SILENT:
V_VT(pVarResult) = VT_BOOL;
V_BOOL(pVarResult) = This->offline;
return S_OK;
}
FIXME("unhandled dispid %d\n", dispIdMember);
return E_NOTIMPL;
}
示例3: test_change_type
static void test_change_type(IVariantChangeType *change_type, VARIANT *src, const conv_results_t *ex)
{
VARIANT v;
call_change_type(change_type, &v, src, VT_I4);
ok(V_I4(&v) == ex->int_result, "V_I4(v) = %d, expected %d\n", V_I4(&v), ex->int_result);
call_change_type(change_type, &v, src, VT_BSTR);
ok(!strcmp_wa(V_BSTR(&v), ex->str_result), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(&v)), ex->str_result);
VariantClear(&v);
call_change_type(change_type, &v, src, VT_BOOL);
ok(V_BOOL(&v) == ex->bool_result, "V_BOOL(v) = %x, expected %x\n", V_BOOL(&v), ex->bool_result);
if(ex->test_double) {
call_change_type(change_type, &v, src, VT_R8);
ok(V_R8(&v) == ex->double_result, "V_R8(v) = %lf, expected %lf\n", V_R8(&v), ex->double_result);
call_change_type(change_type, &v, src, VT_R4);
ok(V_R4(&v) == (float)ex->double_result, "V_R4(v) = %f, expected %f\n", V_R4(&v), (float)ex->double_result);
}
if(V_VT(src) == VT_NULL)
call_change_type(change_type, &v, src, VT_NULL);
else
change_type_fail(change_type, src, VT_NULL, E_NOTIMPL);
if(V_VT(src) == VT_EMPTY)
call_change_type(change_type, &v, src, VT_EMPTY);
else
change_type_fail(change_type, src, VT_EMPTY, E_NOTIMPL);
call_change_type(change_type, &v, src, VT_I2);
ok(V_I2(&v) == (INT16)ex->int_result, "V_I2(v) = %d, expected %d\n", V_I2(&v), ex->int_result);
}
示例4: prepare_for_binding
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
{
HRESULT hres;
if(This->doc_obj->client) {
VARIANT silent, offline;
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
WARN("silent = %s\n", debugstr_variant(&silent));
else if(V_BOOL(&silent))
FIXME("silent == true\n");
}
hres = get_client_disp_property(This->doc_obj->client,
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
if(SUCCEEDED(hres)) {
if(V_VT(&offline) != VT_BOOL)
WARN("offline = %s\n", debugstr_variant(&offline));
else if(V_BOOL(&offline))
FIXME("offline == true\n");
}
}
if(This->window->mon) {
update_doc(This, UPDATE_TITLE|UPDATE_UI);
}else {
update_doc(This, UPDATE_TITLE);
set_current_mon(This->window, mon, flags);
}
if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg = NULL;
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT var, out;
if(flags & BINDING_NAVIGATED) {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
V_VT(&out) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
if(SUCCEEDED(hres))
VariantClear(&out);
}else if(!(flags & BINDING_FROMHIST)) {
V_VT(&var) = VT_I4;
V_I4(&var) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}
IOleCommandTarget_Release(cmdtrg);
}
}
}
示例5: ActiveScriptProperty_SetProperty
static HRESULT WINAPI ActiveScriptProperty_SetProperty(IActiveScriptProperty *iface, DWORD dwProperty,
VARIANT *pvarIndex, VARIANT *pvarValue)
{
CHECK_EXPECT(SetProperty);
ok(dwProperty == SCRIPTPROP_HACK_TRIDENTEVENTSINK, "unexpected property %d\n", dwProperty);
ok(!pvarIndex, "pvarIndex != NULL\n");
ok(pvarValue != NULL, "pvarValue == NULL\n");
ok(V_VT(pvarValue) == VT_BOOL, "V_VT(pvarValue)=%d\n", V_VT(pvarValue));
ok(V_BOOL(pvarValue) == VARIANT_TRUE, "V_BOOL(pvarValue)=%x\n", V_BOOL(pvarValue));
return E_NOTIMPL;
}
示例6: test_change_types
static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_disp)
{
VARIANT v, dst;
HRESULT hres;
static const conv_results_t bool_results[] = {
{0, "false", VARIANT_FALSE, 1,0.0},
{1, "true", VARIANT_TRUE, 1,1.0}};
static const conv_results_t int_results[] = {
{0, "0", VARIANT_FALSE, 1,0.0},
{-100, "-100", VARIANT_TRUE, 1,-100.0},
{0x10010, "65552", VARIANT_TRUE, 1,65552.0}};
static const conv_results_t empty_results =
{0, "undefined", VARIANT_FALSE, 0,0};
static const conv_results_t null_results =
{0, "null", VARIANT_FALSE, 0,0};
static const conv_results_t obj_results =
{10, "strval", VARIANT_TRUE, 1,10.0};
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = VARIANT_FALSE;
test_change_type(change_type, &v, bool_results);
V_BOOL(&v) = VARIANT_TRUE;
test_change_type(change_type, &v, bool_results+1);
V_VT(&v) = VT_I4;
V_I4(&v) = 0;
test_change_type(change_type, &v, int_results);
V_I4(&v) = -100;
test_change_type(change_type, &v, int_results+1);
V_I4(&v) = 0x10010;
test_change_type(change_type, &v, int_results+2);
V_VT(&v) = VT_EMPTY;
test_change_type(change_type, &v, &empty_results);
V_VT(&v) = VT_NULL;
test_change_type(change_type, &v, &null_results);
V_VT(&v) = VT_DISPATCH;
V_DISPATCH(&v) = obj_disp;
test_change_type(change_type, &v, &obj_results);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = VARIANT_FALSE;
V_VT(&dst) = 0xdead;
hres = IVariantChangeType_ChangeType(change_type, &dst, &v, 0, VT_I4);
ok(hres == DISP_E_BADVARTYPE, "ChangeType failed: %08x, expected DISP_E_BADVARTYPE\n", hres);
ok(V_VT(&dst) == 0xdead, "V_VT(dst) = %d\n", V_VT(&dst));
}
示例7: GetCUtilProp
// SupportIRowsetChange ------------------------------------------------
//
// @func This function returns if IrowsetChange is supported
//
BOOL CRowset::SupportIRowsetChange()
{
BOOL fIRowsetChange = FALSE;
ULONG cPropSets = 0;
DBPROPSET * rgPropSets = NULL;
DBPROPID rgPropId[1];
DBPROPIDSET rgPropertySets[1];
// Get the value of the DBPROP_CANHOLDROWS property
rgPropertySets[0].guidPropertySet = DBPROPSET_ROWSET;
rgPropertySets[0].rgPropertyIDs = rgPropId;
rgPropertySets[0].cPropertyIDs = 1;
rgPropId[0] = DBPROP_IRowsetChange;
// Get the IRowsetChange Property from m_pUtilProp
GetCUtilProp()->GetProperties(PROPSET_ROWSET, 1, rgPropertySets,
&cPropSets, &rgPropSets);
// Get the Prompt value
if( V_BOOL(&rgPropSets->rgProperties->vValue) == VARIANT_TRUE )
fIRowsetChange = TRUE;
// release properties
FreeProperties(&cPropSets, &rgPropSets);
return fIRowsetChange;
}
示例8: IsDeferred
static bool IsDeferred(CCUBRIDRowset *pRowset)
{
CComVariant var;
HRESULT hr = pRowset->GetPropValue(&DBPROPSET_ROWSET, DBPROP_IRowsetUpdate, &var);
ATLASSERT(SUCCEEDED(hr));
return V_BOOL(&var)==ATL_VARIANT_TRUE;
}
示例9: switch
const char *debugstr_variant(const VARIANT *v)
{
if (!v) return "(null)";
switch (V_VT(v))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_ERROR:
return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_UINT:
return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
示例10: Global_InvokeEx
static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
switch(id) {
case DISPID_GLOBAL_OK:
ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
ok(pdp != NULL, "pdp == NULL\n");
ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(pei != NULL, "pei == NULL\n");
ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg));
ok(V_BOOL(pdp->rgvarg+1), "%s\n", wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
break;
default:
ok(0, "unexpected call\n");
return E_NOTIMPL;
}
return S_OK;
}
示例11: HTMLElement3_get_disabled
static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
{
HTMLElement *This = impl_from_IHTMLElement3(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
if(This->node.vtbl->get_disabled)
return This->node.vtbl->get_disabled(&This->node, p);
hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
if(hres == DISP_E_UNKNOWNNAME) {
*p = VARIANT_FALSE;
return S_OK;
}
if(FAILED(hres))
return hres;
if(V_VT(var) != VT_BOOL) {
FIXME("value is %s\n", debugstr_variant(var));
return E_NOTIMPL;
}
*p = V_BOOL(var);
return S_OK;
}
示例12: switch
static const char *debugstr_variant(const VARIANT *var)
{
static char buf[400];
if (!var)
return "(null)";
switch (V_VT(var))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_BSTR:
sprintf(buf, "{VT_BSTR: %s}", wine_dbgstr_w(V_BSTR(var)));
break;
case VT_BOOL:
sprintf(buf, "{VT_BOOL: %x}", V_BOOL(var));
break;
case VT_UI4:
sprintf(buf, "{VT_UI4: %u}", V_UI4(var));
break;
default:
sprintf(buf, "{vt %d}", V_VT(var));
break;
}
return buf;
}
示例13: ASSERT
void CCmdTarget::GetStandardProp(const AFX_DISPMAP_ENTRY* pEntry,
VARIANT* pvarResult, UINT* puArgErr)
{
ASSERT(pEntry != NULL);
ASSERT(*puArgErr != 0);
// it is a DISPATCH_PROPERTYGET (for standard, non-function property)
void* pProp = (BYTE*)this + pEntry->nPropOffset;
if (pEntry->vt != VT_VARIANT)
pvarResult->vt = pEntry->vt;
switch (pEntry->vt)
{
case VT_I1:
pvarResult->bVal = *(BYTE*)pProp;
break;
case VT_I2:
pvarResult->iVal = *(short*)pProp;
break;
case VT_I4:
pvarResult->lVal = *(long*)pProp;
break;
case VT_R4:
pvarResult->fltVal = *(float*)pProp;
break;
case VT_R8:
pvarResult->dblVal = *(double*)pProp;
break;
case VT_DATE:
pvarResult->date = *(double*)pProp;
break;
case VT_CY:
pvarResult->cyVal = *(CY*)pProp;
break;
case VT_BSTR:
{
CString* pString = (CString*)pProp;
pvarResult->bstrVal = pString->AllocSysString();
}
break;
case VT_ERROR:
pvarResult->scode = *(SCODE*)pProp;
break;
case VT_BOOL:
V_BOOL(pvarResult) = (VARIANT_BOOL)(*(BOOL*)pProp != 0 ? -1 : 0);
break;
case VT_VARIANT:
if (VariantCopy(pvarResult, (LPVARIANT)pProp) != S_OK)
*puArgErr = 0;
break;
case VT_DISPATCH:
case VT_UNKNOWN:
pvarResult->punkVal = *(LPDISPATCH*)pProp;
if (pvarResult->punkVal != NULL)
pvarResult->punkVal->AddRef();
break;
default:
*puArgErr = 0;
}
}
示例14: switch
wchar_t *Variant2CWString(VARIANT *result){
switch(V_VT(result)){
case VT_EMPTY:
return L"empty";
break;
case VT_NULL:
return L"null";
break;
case VT_I2: // short
return Number2String((long)V_I2(result));
break;
case VT_I4: // long
return Number2String((long)V_I4(result));
break;
case VT_R4: // float
return Double2String(V_R4(result));
break;
case VT_R8: // double
return Double2String(V_R8(result));
break;
case VT_BOOL: //(True -1,False 0)
return (V_BOOL(result) ? L"True" : L"False");
break;
case VT_BSTR:
return (wchar_t*)(V_BSTR(result));
break;
case VT_DATE:
return Date2String( V_DATE(result));
break;
}
}
示例15: change_type
static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *caller)
{
V_VT(dst) = VT_EMPTY;
if(caller) {
IVariantChangeType *change_type = NULL;
HRESULT hres;
hres = IServiceProvider_QueryService(caller, &SID_VariantConversion, &IID_IVariantChangeType, (void**)&change_type);
if(SUCCEEDED(hres)) {
hres = IVariantChangeType_ChangeType(change_type, dst, src, LOCALE_NEUTRAL, vt);
IVariantChangeType_Release(change_type);
return hres;
}
}
switch(vt) {
case VT_BOOL:
if(V_VT(src) == VT_BSTR) {
V_VT(dst) = VT_BOOL;
V_BOOL(dst) = V_BSTR(src) && *V_BSTR(src) ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
break;
}
return VariantChangeType(dst, src, 0, vt);
}