Commits

Author Commit Message Labels Comments Date
aw...@GunDog7
Fixed enum_iterator copy constructor so it actually compiles.
alamaison
Added new enum_iterator that can iterate over the items of any COM enumerator. The details of how the items are copied into the target need some work. The target may be a POD, in which case we must be careful to clear them, or a smart wrapper, in which case we don't need to. It's not clear how to do this in a way that satisfies both well.
alamaison
Trim trailine newline from what() message. FormatMessage appends '\r\n' to the error messages it produces. This isn't how it should be; it should be up the the caller to decide whether the messages require a new line. For example, when displaying the message in a GUI, you are very unlikely to want a new line after the message. This change fixes it by omitting the '\r\n' from the string it returns.
alamaison
Fix template argument inference problems in com_error_from_interface. In some situations, when passing in raw interface pointer, the compiler couldn't infoer the template parameter of the com_ptr argument. Overloading com_error_from_interface with a version specifically for raw pointers seems to help.
alamaison
Make error_fwd.h self-sufficient.
alamaison
Made bstr_t.detach() public. detach() is dangerous but that is not enough reason to make it private. Used with care it is very useful.
alamaison
Replaced extra com_error constructor overload with named function. Explicit is better than implicit.
alamaison
Fixed Clone(). Clone() reset the iterator position in the clone rather than preserving it. This deafeated the point of cloning. Fixed by maintaining the current position as part of the store policy object. This is copied when the clone is made, thereby maintaining the current position information.
alamaison
Added smart_enumeration, a COM enumerator that wraps a smart pointer to a collection. This change extracts the common enumerator implementation into a separate class, enumeration. The different enumerator characteristics are given as policy classes to this template class.
alamaison
Split enum.h into pieces. enum.h contained several, unrelated pieces of code. This change splits them into separate files making it easier to extend in future.
alamaison
Downgrade Test project files to VS2005. Visual Studio project files are only forward compatible so should be maintained at the oldest supported version.
alamaison
Added constructor that uses last error info if approriate. When a method is called on an interface pointer and it returns a failure, the com_error the caller should throw can include information from IErrorInfo if the interface in question supports it. The new constructor takes this interface pointer as a paramter, queries it for ErrorInfo support and, if successful, augments the com_error with the last ErrorInfo set on the calling thread.
alamaison
Fully qualify nil. Using 'comet::nil' instead of just 'nil' in the COMET_LIST_TEMPLATE and COMET_LIST_NIL macros means they can be used outside of an enclosing comet namespace.
alamaison
Make com_ptr::iid() public. This allows code such as: com_ptr<IInterface> ptr; HRESULT hr = BindToObject(ptr.iid(), reinterpret_cast<void**>(ptr.out())); instead of: com_ptr<IInterface> ptr; HRESULT hr = BindToObject(uuidof(ptr.in()), reinterpret_cast<void**>(ptr.out())); Removing the strange 'uuidof(ptr.in())' makes it more obvious what is going on here. There is no loss of encapsulation by making iid()…
alamaison
Make handle_except.h self-contained. The code in handle_except.h depends on error.h so it should include it.
alamaison
Made datetime_t converters const-correct. To convert a const datetime_t to a FILETIME or a SYSTEMTIME the converter methods must be const.
alamaison
Fixed variant_t comparison. As documented here http://source.winehq.org/WineAPI/VarCmp.html (and verified by my own tests), the native Windows VarCmp is severely brain-damaged. Specifically, it can't compare numeric VARIANTs of type I1, UI2, UI4, UI8, INT or UINT. This fix uses a wrapper around VarCmp that performs the comparison itself for those VT types. Added a series of tests to verify this fixed behaviour. Without t…
alamaison
Added support for VT_I8 (LONGLONG) and VT_UI8 (ULONGLONG) to variant_t.
alamaison
Fixed bizarre header interaction. Including variant.h at the bottom of bstr.h prevented datetime.h from compiling on its own! Removed the include as well as several unused forward-decls. Added a test case to verify this works.
alamaison
Fixed bounds error in bstr_t::s_str(). The method was reading on character too many from the wrapped BSTR and writing the converted character to one byte after the std::string buffer. While this mostly works because this will write the the NULL-terminator that mostly implementation put after the buffer it is not legal and could cause problems if the character happens not to be NULL (possible as BSTRs don't have to be NULL-terminated).
alamaison
Fixed conversion from size_t to int warning in bstr::s_str(). Caused by passing size_t values to WideCharToMultiByte. Fixed by adding an explicit length check before casting the size_t to int.
alamaison
Fixed conversion from size_t to int warning. Caused by convert_str which stored the result of the first call to MultiByteToWideChar in a size_t and then passed that to the second call which was expecting an int. Also added an explicit length check to construct(const char* s, size_t len) before casting the original size_t to an int and changed expection specifications into comments.
alamaison
Removed extra level of indentation from bstr_t. Part of the bstr_t definition was randomly indented by one tabstop more than the rest.
Alexander Lamaison
Made QueryInterface set out-param to NULL on failure. By COM rules, all [out] parameters must be set to NULL explicitly when the method returns a failure code. See: http://msdn.microsoft.com/en-us/library/ms686638%28VS.85%29.aspx http://msdn.microsoft.com/en-us/library/ms810016.aspx
Alexander Lamaison
Fixed unused parameter warnings.
sofusmortensen
Expanding number of parameters
sofusmortensen
Fixed bug in tlb2h.cpp invalid code generated for defaultvalue attribute on DATE parameters
sofusmortensen
Upgraded project to vc2008
sofusmortensen
Various changes - origin lost
sofusmortensen
1b32