Hi Nikolay,

On 9/28/10 1:30 PM, Nikolay Sivov wrote:
 Resent for series completeness.

+    hr = VariantChangeType(&str,&user, 0, VT_BSTR);
+    if (hr == S_OK)
+    {
+        This->user = SysAllocString(V_BSTR(&str));
+        VariantClear(&str);
+    }

You already own the reference to string in str VARIANT, so you can just use it 
|This->user = V_BSTR(&str);| and remove VariantClear call.


+    hr = VariantChangeType(&str,&password, 0, VT_BSTR);
+    if (hr == S_OK)
+    {
+        This->password = SysAllocString(V_BSTR(&str));
+        VariantClear(&str);
+    }

Same here.


Jacek



Reply via email to