aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/windows/msofficecomm/MessengerClassFactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/windows/msofficecomm/MessengerClassFactory.h')
-rw-r--r--src/native/windows/msofficecomm/MessengerClassFactory.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/native/windows/msofficecomm/MessengerClassFactory.h b/src/native/windows/msofficecomm/MessengerClassFactory.h
new file mode 100644
index 0000000..52c1a2b
--- /dev/null
+++ b/src/native/windows/msofficecomm/MessengerClassFactory.h
@@ -0,0 +1,39 @@
+/*
+ * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+#ifndef _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_
+#define _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_
+
+#include "ClassFactory.h"
+#include <msgrua.h>
+
+/**
+ * Implements the <tt>IClassFactory</tt> interface for the <tt>IMessenger</tt>
+ * interface implementation.
+ *
+ * @author Lyubomir Marinov
+ */
+class MessengerClassFactory
+ : public ClassFactory
+{
+public:
+ MessengerClassFactory()
+ : ClassFactory(CLSID_Messenger), _messenger(NULL) {}
+
+ STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, PVOID *);
+
+protected:
+ virtual ~MessengerClassFactory()
+ {
+ if (_messenger)
+ _messenger->Release();
+ }
+
+private:
+ IWeakReference *_messenger;
+};
+
+#endif /* _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_ */