?

Log in

No account? Create an account

Previous Entry | Next Entry

Have I Ever Mentioned How Much I Love COM

 

Oh, and it is someone else's code too. Many years old.

 

VARIANT variableName;
VariantInit(&variableName);
V_BSTR(&variableName) = SysAllocString(L"SomeString");
V_VT(&variableName) = VT_BSTR;
hr = pUser->Put(CComBSTR("AnotherString"), variableName);
VariantClear(&variableName);

if (FAILED(hr) == TRUE) {
  ThrowADSIError(hr, "Error setting password status.");
}