21#using "cli_uretypes.dll"
23#include "rtl/ustring.hxx"
24#include <uno/lbnames.h>
25#include "uno/mapping.hxx"
38 return gcnew ::System::String(
39 reinterpret_cast<wchar_t const *
>(ustr.getStr()), 0, ustr.getLength());
44 OSL_ASSERT(
sizeof (
wchar_t) ==
sizeof (
sal_Unicode) );
45 pin_ptr<wchar_t const> chars = PtrToStringChars( str );
46 return OUString(
reinterpret_cast<sal_Unicode const *
>(chars), str->Length);
51 css::uno::Reference< T >
const & x )
53 css::uno::Mapping mapping(
54 CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_CLI );
55 OSL_ASSERT( mapping.is() );
58 throw css::uno::RuntimeException(
59 "cannot get mapping from C++ to CLI!",
61 css::uno::XInterface >() );
65 reinterpret_cast< intptr_t
>(
67 ::System::Runtime::InteropServices::GCHandle ^ handle = ::System::Runtime::InteropServices::GCHandle::FromIntPtr(::System::IntPtr(intptr));
68 ::System::Object ^ ret = handle->Target;
75 css::uno::Reference< T > * pRet, ::System::Object ^ x )
77 css::uno::Mapping mapping(
78 UNO_LB_CLI, CPPU_CURRENT_LANGUAGE_BINDING_NAME );
79 OSL_ASSERT( mapping.is() );
82 throw css::uno::RuntimeException(
83 "cannot get mapping from CLI to C++!",
85 css::uno::XInterface >() );
88 ::System::Runtime::InteropServices::GCHandle handle(
89 ::System::Runtime::InteropServices::GCHandle::Alloc(
x ) );
92 reinterpret_cast< void **
>( &ret ),
93 reinterpret_cast< void *
>(
94 ::System::Runtime::InteropServices::GCHandle::op_Explicit( handle )
100#error
ERROR: either _WIN64 or _WIN32 must be defined
101 ERROR: either _WIN64 or _WIN32 must be defined
106 pRet->set( ret, SAL_NO_ACQUIRE );
void to_uno(css::uno::Reference< T > *pRet, ::System::Object ^ x)
OUString String_to_ustring(::System::String ^ str)
inline ::System::String ustring_to_String(OUString const &ustr)
inline ::System::Object to_cli(css::uno::Reference< T > const &x)