1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ole2uno.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
37 #endif // _MSC_VER > 1000
41 #define _WIN32_WINNT 0x0400
45 #if OSL_DEBUG_LEVEL > 0
46 //#define _ATL_DEBUG_INTERFACES
49 #pragma warning (push,1)
50 #pragma warning (disable:4917)
51 #pragma warning (disable:4005)
52 #pragma warning (disable:4548)
54 #include <tools/prewin.h>
56 #if (_MSC_VER >= 1200) || defined(__MINGW32__)
59 #include <tools/postwin.h>
61 #include <tools/presys.h>
63 #include <tools/postsys.h>
66 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
67 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
68 #include <com/sun/star/script/XInvocation.hpp>
69 #include <com/sun/star/registry/XRegistryKey.hpp>
70 #include <com/sun/star/bridge/XBridgeSupplier2.hpp>
71 #include <com/sun/star/bridge/ModelDependent.hpp>
72 #include <com/sun/star/reflection/InvocationTargetException.hpp>
73 #include <com/sun/star/uno/Exception.hpp>
74 #include <com/sun/star/beans/UnknownPropertyException.hpp>
75 #include <cppuhelper/implbase2.hxx>
76 #include <cppuhelper/implbase1.hxx>
77 #include <cppuhelper/typeprovider.hxx>
78 #include <cppuhelper/factory.hxx>
79 #include <sal/types.h>
80 #include <typelib/typeclass.h>
81 #include <osl/diagnose.h>
82 #include <osl/mutex.hxx>
83 #include <com/sun/star/uno/Reference.h>
84 #include <rtl/process.h>
87 #define UNO_2_OLE_EXCEPTIONCODE 1001
88 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
89 using namespace com::sun::star::uno
;
90 using namespace com::sun::star::lang
;
91 using namespace com::sun::star::script
;
92 using namespace com::sun::star::registry
;
93 using namespace com::sun::star::reflection
;
94 using namespace com::sun::star::beans
;
101 namespace ole_adapter
104 const VARTYPE
getVarType( const Any
& val
);
105 /* creates a Type object for a given type name.
107 The function returns false if the name does not represent
110 bool getType( BSTR name
, Type
& type
);
111 void o2u_attachCurrentThread();
113 struct equalOUString_Impl
115 bool operator()(const OUString
& s1
, const OUString
& s2
) const
121 struct hashOUString_Impl
123 size_t operator()(const OUString
& rName
) const
125 return rName
.hashCode();
130 class BridgeRuntimeError
133 BridgeRuntimeError(const OUString
& sMessage
)
141 Mutex
* getBridgeMutex();
147 #endif // _OLE2UNO_HXX