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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -