c++ - How to pass address of BOOL to a method accepting address of VARIANT_BOOL? -
i have method takes parameter of variant_bool
pointer
stdmethod(get_test)(variant_bool* result)
i have bool
test variable want pass method. has bool
, not variant_bool
.
bool test;
is there way pass address of bool
in place of address of variant_bool
? tried
get_test( &((variant_bool)test));
but did not work.
those types have different sizes , use different values true. cast work if initialize value upper word zero. don't , instead:
variant_bool temp; hresult hr = get_test(&temp); if (succeeded(hr)) { bool test = temp != variant_false; // etc... }
Comments
Post a Comment