From 40c6f07a5e3f46ec138be6ac2df32f59f92ac0c3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 22 Apr 2006 16:26:24 +0000 Subject: [PATCH] Add ms_atl.h git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2958 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/compat/ms_atl.h | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 bacula/src/win32/compat/ms_atl.h diff --git a/bacula/src/win32/compat/ms_atl.h b/bacula/src/win32/compat/ms_atl.h new file mode 100644 index 0000000000..29589798a5 --- /dev/null +++ b/bacula/src/win32/compat/ms_atl.h @@ -0,0 +1,53 @@ +/* + * Minimal replacement for class CComPtr and CComBSTR + * Based on common public IUnknown interface only + */ + +template class CComPtr +{ + +public: + +/* Attribute(s) ... */ + T* p; + +/* Creation ... */ + CComPtr() + { + p = NULL; + } + +/* Destructor ... */ + ~CComPtr() + { + if (p) + p->Release(); + } +}; + +class CComBSTR +{ + +public: + + BSTR p; + +/* Creation ... */ + CComBSTR() + { + p = NULL; + } + +/* Destructor ... */ + ~CComBSTR() + { + ::SysFreeString(p); + } + +/* Address-of operator */ + BSTR* operator&() + { + return &p; + } + +}; -- 2.39.5