+// ----------------------------------------------------------------------------
+// initialize/cleanup OLE
+// ----------------------------------------------------------------------------
+
+// call OleInitialize() or CoInitialize[Ex]() depending on the platform
+//
+// return true if ok, false otherwise
+inline bool wxOleInitialize()
+{
+ // we need to initialize OLE library
+#ifdef __WXWINCE__
+ if ( FAILED(::CoInitializeEx(NULL, COINIT_MULTITHREADED)) )
+#else
+ if ( FAILED(::OleInitialize(NULL)) )
+#endif
+ {
+ wxLogError(_("Cannot initialize OLE"));
+
+ return false;
+ }
+
+ return true;
+}
+
+inline void wxOleUninitialize()
+{
+#ifdef __WXWINCE__
+ ::CoUninitialize();
+#else
+ ::OleUninitialize();
+#endif
+}
+