[vbox-dev] COM interface changes in v5.0 - What it means ?
Alexey Eromenko
al4321 at gmail.com
Fri Apr 3 23:00:25 GMT 2015
VirtualBox 4.3 : (USBControllerImpl.cpp)
STDMETHODIMP USBController::COMGETTER(Name) (BSTR *aName)
{
CheckComArgOutPointerValid(aName);
AutoCaller autoCaller(this);
if (FAILED(autoCaller.rc())) return autoCaller.rc();
/* strName is constant during life time, no need to lock */
m->bd->strName.cloneTo(aName);
VirtualBox 5.0 :
HRESULT USBController::getName(com::Utf8Str &aName)
{
/* strName is constant during life time, no need to lock */
aName = m->bd->strName;
==================================================
I wanna understand:
What is STDMETHODIMP ?
What is HRESULT?
How did COMGETTER* became get* ?
What was the meaning of "AutoCaller autoCaller(this);" ?
BSTR equals to char* string ? So if Unicode converts to it, only ASCII
will work?
Why BSTR suddenly became com::Utf8Str ?
How old COM code compares to the new one ?
And where this magic happens in new ver ? (CheckComArgOutPointerValid(), ...)
P.S. It would help me very much if I could use something more
advanced, like Qt String in COM backend, instead of BSTR, spending
_days_ trying to figure out how to convert this to that, or split
string or add Unicode to it somehow. (coming from Python, so Unicode
is automatic there...)
--
-Alexey Eromenko "Technologov"
More information about the vbox-dev
mailing list