Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/COM_Value.h

Issue 6650591174459392: Issues #276, #1163 - introduce class IncomingParam (Closed)
Patch Set: Created July 25, 2014, 11:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/COM_Value.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/COM_Value.h
===================================================================
--- a/src/plugin/COM_Value.h
+++ b/src/plugin/COM_Value.h
@@ -115,6 +115,27 @@
*/
BSTR_Argument& operator=( BSTR_Argument&& ); // = delete
};
+
+ /**
+ * Constructor class for BSTR [in] parameters arriving from our COM entry points.
+ *
+ * The life cycle of a BSTR value that comes to us as an [in] parameter is entirely managed by the caller.
+ * Thus this class simply derives from std::wstring and provides an appropriate constructor.
+ *
+ * This class is a narrow technique toward a larger goal of eliminating CComBSTR,
+ * which had been used for these parameters.
+ * All the uses, however, had been for IDispatch entry points, which are all VARIANT.
+ * In all cases, the caller much first check the type of the VARIANT structure before constructing an instance.
+ * Perhaps better would be a class, say, wstring_Incoming_Param that took a VARIANT as a constructor argument
+ * and converted it to a string.
+ * Such a class, however, is beyond the scope of the work that this class was a part of.
+ */
+ class Incoming_Param
+ : public std::wstring
+ {
+ public:
+ Incoming_Param( BSTR b );
sergei 2014/07/28 09:24:31 Instead of commenting all bad things here, I will
Eric 2014/07/29 19:53:08 Oh, that's just awful. If there's one thing I've l
+ };
}
}
« no previous file with comments | « no previous file | src/plugin/COM_Value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld