OLD | NEW |
1 /** | 1 /** |
2 * \file COM_Value.cpp Support for the values used in COM and Automation. | 2 * \file COM_Value.cpp Support for the values used in COM and Automation. |
3 */ | 3 */ |
4 #include "COM_Value.h" | 4 #include "COM_Value.h" |
5 #include <stdexcept> | 5 #include <stdexcept> |
6 | 6 |
7 using namespace AdblockPlus::COM; | 7 using namespace AdblockPlus::COM; |
8 | 8 |
9 /* | 9 /* |
10 * MSDN SysAllocStringLen function http://msdn.microsoft.com/en-us/library/windo
ws/desktop/ms221639%28v=vs.85%29.aspx | 10 * MSDN SysAllocStringLen function http://msdn.microsoft.com/en-us/library/windo
ws/desktop/ms221639%28v=vs.85%29.aspx |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 BSTR_Argument::operator std::wstring() const | 57 BSTR_Argument::operator std::wstring() const |
58 { | 58 { |
59 if ( !bstr ) | 59 if ( !bstr ) |
60 { | 60 { |
61 return std::wstring(); | 61 return std::wstring(); |
62 } | 62 } |
63 return std::wstring( bstr, SysStringLen( bstr ) ); | 63 return std::wstring( bstr, SysStringLen( bstr ) ); |
64 } | 64 } |
| 65 |
| 66 |
| 67 namespace |
| 68 { |
| 69 /** |
| 70 * Pre-construction assistant for wstring_Incoming_Param. |
| 71 * |
| 72 * Because wstring_Incoming_Param is a derived class, |
| 73 * we need to have a wstring value to initialize the base class. |
| 74 */ |
| 75 std::wstring construct_Incoming_Param( BSTR b ) |
| 76 { |
| 77 if ( !b ) |
| 78 { |
| 79 return std::wstring(); |
| 80 } |
| 81 return std::wstring( b, SysStringLen( b ) ); |
| 82 } |
| 83 } |
| 84 |
| 85 Incoming_Param::Incoming_Param( BSTR b ) |
| 86 : std::wstring( construct_Incoming_Param( b ) ) |
| 87 { |
| 88 } |
OLD | NEW |