summaryrefslogtreecommitdiff
path: root/extensions/test/ole
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 15:18:56 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 15:18:56 +0000
commit95117e7fefa9ae82431dcdffd1e58495730f6f54 (patch)
tree158386e9f19cda5c69023d678c4d3313435a206d /extensions/test/ole
initial import
Diffstat (limited to 'extensions/test/ole')
-rw-r--r--extensions/test/ole/AxTestComponents/AxTestComponents.cpp131
-rw-r--r--extensions/test/ole/AxTestComponents/AxTestComponents.def9
-rw-r--r--extensions/test/ole/AxTestComponents/AxTestComponents.dsp323
-rw-r--r--extensions/test/ole/AxTestComponents/AxTestComponents.idl158
-rw-r--r--extensions/test/ole/AxTestComponents/AxTestComponents.rc198
-rw-r--r--extensions/test/ole/AxTestComponents/Basic.cpp523
-rw-r--r--extensions/test/ole/AxTestComponents/Basic.h160
-rw-r--r--extensions/test/ole/AxTestComponents/Basic.rgs26
-rw-r--r--extensions/test/ole/AxTestComponents/StdAfx.cpp69
-rw-r--r--extensions/test/ole/AxTestComponents/StdAfx.h87
-rw-r--r--extensions/test/ole/AxTestComponents/resource.h77
-rw-r--r--extensions/test/ole/JScriptNewStyle.htm1039
-rw-r--r--extensions/test/ole/OleClient/clientTest.cxx536
-rw-r--r--extensions/test/ole/OleClient/makefile.mk128
-rw-r--r--extensions/test/ole/OleClient/readme.txt7
-rw-r--r--extensions/test/ole/OleConverterVar1/convTest.cxx678
-rw-r--r--extensions/test/ole/OleConverterVar1/makefile.mk136
-rw-r--r--extensions/test/ole/OleConverterVar1/readme.txt2
-rw-r--r--extensions/test/ole/OleConverterVar1/smartarray.h267
-rw-r--r--extensions/test/ole/OleTest.htm943
-rw-r--r--extensions/test/ole/callUnoToJava.htm516
-rw-r--r--extensions/test/ole/cpnt/cpnt.cxx1545
-rw-r--r--extensions/test/ole/cpnt/exports.dxp3
-rw-r--r--extensions/test/ole/cpnt/makefile.mk146
-rw-r--r--extensions/test/ole/cpnt/readme.txt5
-rw-r--r--extensions/test/ole/cpptest/StdAfx.cpp68
-rw-r--r--extensions/test/ole/cpptest/StdAfx.h85
-rw-r--r--extensions/test/ole/cpptest/cpptest.cpp113
-rw-r--r--extensions/test/ole/cpptest/cpptest.dsp113
-rw-r--r--extensions/test/ole/cpptest/cpptest.dsw29
-rw-r--r--extensions/test/ole/idl/oletest.idl309
-rw-r--r--extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp68
-rw-r--r--extensions/test/ole/unoTocomCalls/Test/StdAfx.h89
-rw-r--r--extensions/test/ole/unoTocomCalls/Test/Test.cpp277
-rw-r--r--extensions/test/ole/unoTocomCalls/Test/Test.dsp113
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Basic.rgs26
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/BasicTest.rgs26
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp517
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h167
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.rgs26
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp113
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h98
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.rgs26
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp72
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h89
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp134
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.dsp335
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl181
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.rc197
-rw-r--r--extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h79
-rw-r--r--extensions/test/ole/unoTocomCalls/readme.txt6
51 files changed, 11068 insertions, 0 deletions
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.cpp b/extensions/test/ole/AxTestComponents/AxTestComponents.cpp
new file mode 100644
index 000000000000..e6e98bbe80a5
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/AxTestComponents.cpp
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: AxTestComponents.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+// Note: Proxy/Stub Information
+// To build a separate proxy/stub DLL,
+// run nmake -f AxTestComponentsps.mk in the project directory.
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "AxTestComponents.h"
+
+#include "AxTestComponents_i.c"
+#include "Basic.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_Basic, CBasic)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ _Module.Init(ObjectMap, hInstance, &LIBID_AXTESTCOMPONENTSLib);
+ DisableThreadLibraryCalls(hInstance);
+ }
+ else if (dwReason == DLL_PROCESS_DETACH)
+ _Module.Term();
+ return TRUE; // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+ return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+ return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+ // registers object, typelib and all interfaces in typelib
+ return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+ return _Module.UnregisterServer(TRUE);
+}
+
+
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.def b/extensions/test/ole/AxTestComponents/AxTestComponents.def
new file mode 100644
index 000000000000..6c19f0c53300
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/AxTestComponents.def
@@ -0,0 +1,9 @@
+; AxTestComponents.def : Declares the module parameters.
+
+LIBRARY "AxTestComponents.DLL"
+
+EXPORTS
+ DllCanUnloadNow @1 PRIVATE
+ DllGetClassObject @2 PRIVATE
+ DllRegisterServer @3 PRIVATE
+ DllUnregisterServer @4 PRIVATE
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.dsp b/extensions/test/ole/AxTestComponents/AxTestComponents.dsp
new file mode 100644
index 000000000000..77c14a7ddc65
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/AxTestComponents.dsp
@@ -0,0 +1,323 @@
+# Microsoft Developer Studio Project File - Name="AxTestComponents" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=AxTestComponents - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "AxTestComponents.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "AxTestComponents.mak" CFG="AxTestComponents - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "AxTestComponents - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "AxTestComponents - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "AxTestComponents - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "AxTestComponents - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "AxTestComponents - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "AxTestComponents - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "AxTestComponents - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# Begin Custom Build - Performing registration
+OutDir=.\Debug
+TargetPath=.\Debug\AxTestComponents.dll
+InputPath=.\Debug\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "AxTestComponents - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# Begin Custom Build - Performing registration
+OutDir=.\DebugU
+TargetPath=.\DebugU\AxTestComponents.dll
+InputPath=.\DebugU\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "AxTestComponents - Win32 Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinSize"
+# PROP BASE Intermediate_Dir "ReleaseMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinSize"
+# PROP Intermediate_Dir "ReleaseMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseMinSize
+TargetPath=.\ReleaseMinSize\AxTestComponents.dll
+InputPath=.\ReleaseMinSize\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "AxTestComponents - Win32 Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinDependency"
+# PROP Intermediate_Dir "ReleaseMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseMinDependency
+TargetPath=.\ReleaseMinDependency\AxTestComponents.dll
+InputPath=.\ReleaseMinDependency\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "AxTestComponents - Win32 Unicode Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinSize"
+# PROP BASE Intermediate_Dir "ReleaseUMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinSize"
+# PROP Intermediate_Dir "ReleaseUMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseUMinSize
+TargetPath=.\ReleaseUMinSize\AxTestComponents.dll
+InputPath=.\ReleaseUMinSize\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "AxTestComponents - Win32 Unicode Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinDependency"
+# PROP Intermediate_Dir "ReleaseUMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseUMinDependency
+TargetPath=.\ReleaseUMinDependency\AxTestComponents.dll
+InputPath=.\ReleaseUMinDependency\AxTestComponents.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ENDIF
+
+# Begin Target
+
+# Name "AxTestComponents - Win32 Debug"
+# Name "AxTestComponents - Win32 Unicode Debug"
+# Name "AxTestComponents - Win32 Release MinSize"
+# Name "AxTestComponents - Win32 Release MinDependency"
+# Name "AxTestComponents - Win32 Unicode Release MinSize"
+# Name "AxTestComponents - Win32 Unicode Release MinDependency"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\AxTestComponents.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\AxTestComponents.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\AxTestComponents.idl
+# ADD MTL /tlb ".\AxTestComponents.tlb" /h "AxTestComponents.h" /iid "AxTestComponents_i.c" /Oicf
+# End Source File
+# Begin Source File
+
+SOURCE=.\AxTestComponents.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\Basic.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Basic.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Basic.rgs
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.idl b/extensions/test/ole/AxTestComponents/AxTestComponents.idl
new file mode 100644
index 000000000000..3885bc19f1e3
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/AxTestComponents.idl
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: AxTestComponents.idl,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// AxTestComponents.idl : IDL source for AxTestComponents.dll
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (AxTestComponents.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+ [
+ object,
+ uuid(BFE10EBD-8584-11D4-8335-005004526AB4),
+ dual,
+ helpstring("IBasic Interface"),
+ pointer_default(unique)
+ ]
+ interface IBasic : IDispatch
+ {
+ [id(1), helpstring("method inByte")] HRESULT inByte([in] unsigned char val);
+ [id(2), helpstring("method inShort")] HRESULT inShort([in] short val);
+ [id(3), helpstring("method inLong")] HRESULT inLong([in] long val);
+ [id(4), helpstring("method inString")] HRESULT inString([in] BSTR val);
+ [id(5), helpstring("method inFloat")] HRESULT inFloat([in] float val);
+ [id(6), helpstring("method inDouble")] HRESULT inDouble([in] double val);
+ [id(7), helpstring("method inVariant")] HRESULT inVariant([in] VARIANT val);
+ [id(8), helpstring("method inArray")] HRESULT inArray([in] SAFEARRAY(VARIANT) val);
+ [id(9), helpstring("method inObject")] HRESULT inObject([in] IDispatch* val);
+ [id(12), helpstring("method inoutByte")] HRESULT inoutByte([in,out] unsigned char* val);
+ [id(13), helpstring("method inoutShort")] HRESULT inoutShort([in,out] short* val);
+ [id(14), helpstring("method inoutLong")] HRESULT inoutLong([in,out] long * val);
+ [id(15), helpstring("method inoutString")] HRESULT inoutString([in, out] BSTR* val);
+ [id(16), helpstring("method inoutFloat")] HRESULT inoutFloat([in,out] float * val);
+ [id(17), helpstring("method inoutDouble")] HRESULT inoutDouble([in,out] double * val);
+ [id(18), helpstring("method inoutVariant")] HRESULT inoutVariant([in,out] VARIANT * val);
+ [id(19), helpstring("method inoutArray")] HRESULT inoutArray([in,out] SAFEARRAY(VARIANT) * val);
+ [id(20), helpstring("method inoutObject")] HRESULT inoutObject([in,out] IDispatch** val);
+ [id(23), helpstring("method outByte")] HRESULT outByte([out] unsigned char* val);
+ [id(24), helpstring("method outShort")] HRESULT outShort([out] short* val);
+ [id(25), helpstring("method outLong")] HRESULT outLong([out] long* val);
+ [id(26), helpstring("method outString")] HRESULT outString([out] BSTR* val);
+ [id(27), helpstring("method outFloat")] HRESULT outFloat([out] float* val);
+ [id(28), helpstring("method outDouble")] HRESULT outDouble([out] double* val);
+ [id(29), helpstring("method outVariant")] HRESULT outVariant([out] VARIANT* val);
+ [id(30), helpstring("method outArray")] HRESULT outArray([out] SAFEARRAY(VARIANT) * val);
+ [id(31), helpstring("method outObject")] HRESULT outObject([out] IDispatch** val);
+ [propget, id(34), helpstring("property prpByte")] HRESULT prpByte([out, retval] unsigned char *pVal);
+ [propput, id(34), helpstring("property prpByte")] HRESULT prpByte([in] unsigned char newVal);
+ [propget, id(35), helpstring("property prpShort")] HRESULT prpShort([out, retval] short *pVal);
+ [propput, id(35), helpstring("property prpShort")] HRESULT prpShort([in] short newVal);
+ [propget, id(36), helpstring("property prpLong")] HRESULT prpLong([out, retval] long *pVal);
+ [propput, id(36), helpstring("property prpLong")] HRESULT prpLong([in] long newVal);
+ [propget, id(37), helpstring("property prpString")] HRESULT prpString([out, retval] BSTR *pVal);
+ [propput, id(37), helpstring("property prpString")] HRESULT prpString([in] BSTR newVal);
+ [propget, id(38), helpstring("property prpFloat")] HRESULT prpFloat([out, retval] float *pVal);
+ [propput, id(38), helpstring("property prpFloat")] HRESULT prpFloat([in] float newVal);
+ [propget, id(39), helpstring("property prpDouble")] HRESULT prpDouble([out, retval] double *pVal);
+ [propput, id(39), helpstring("property prpDouble")] HRESULT prpDouble([in] double newVal);
+ [propget, id(40), helpstring("property prpVariant")] HRESULT prpVariant([out, retval] VARIANT *pVal);
+ [propput, id(40), helpstring("property prpVariant")] HRESULT prpVariant([in] VARIANT newVal);
+ [propget, id(41), helpstring("property prpArray")] HRESULT prpArray([out, retval]SAFEARRAY(VARIANT) *pVal);
+ [propput, id(41), helpstring("property prpArray")] HRESULT prpArray([in] SAFEARRAY(VARIANT) newVal);
+ [propget, id(42), helpstring("property prpObject")] HRESULT prpObject([out, retval] IDispatch* *pVal);
+ [propput, id(42), helpstring("property prpObject")] HRESULT prpObject([in] IDispatch* newVal);
+ [id(43), helpstring("method mixed1")] HRESULT mixed1(
+ [in] unsigned char aChar,
+ [out] unsigned char *outChar,
+ [in, out] unsigned char* inoutChar,
+ [in] VARIANT var,
+ [out] VARIANT* outVar,
+ [in,out] VARIANT* inoutVar,
+ [in] SAFEARRAY(VARIANT) ar,
+ [out] SAFEARRAY(VARIANT)* outAr,
+ [in,out] SAFEARRAY(VARIANT)* inoutAr,
+ [in] IDispatch *disp,
+ [out] IDispatch** outDisp,
+ [in,out] IDispatch** inoutDisp);
+ [id(44), helpstring("method inSequenceLong")] HRESULT inSequenceLong([in] SAFEARRAY(long) ar);
+
+ };
+
+[
+ uuid(BFE10EB1-8584-11D4-8335-005004526AB4),
+ version(1.0),
+ helpstring("AxTestComponents 1.0 Type Library")
+]
+library AXTESTCOMPONENTSLib
+{
+ importlib("stdole32.tlb");
+ importlib("stdole2.tlb");
+
+ [
+ uuid(BFE10EBE-8584-11D4-8335-005004526AB4),
+ helpstring("Basic Class")
+ ]
+ coclass Basic
+ {
+ [default] interface IBasic;
+ };
+};
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.rc b/extensions/test/ole/AxTestComponents/AxTestComponents.rc
new file mode 100644
index 000000000000..4224fae2fc77
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/AxTestComponents.rc
@@ -0,0 +1,198 @@
+/*************************************************************************
+*
+* $RCSfile: AxTestComponents.rc,v $
+*
+* $Revision: 1.1.1.1 $
+*
+* last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+*
+* The Contents of this file are made available subject to the terms of
+* either of the following licenses
+*
+* - GNU Lesser General Public License Version 2.1
+* - Sun Industry Standards Source License Version 1.1
+*
+* Sun Microsystems Inc., October, 2000
+*
+* GNU Lesser General Public License Version 2.1
+* =============================================
+* Copyright 2000 by Sun Microsystems, Inc.
+* 901 San Antonio Road, Palo Alto, CA 94303, USA
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License version 2.1, as published by the Free Software Foundation.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+* MA 02111-1307 USA
+*
+*
+* Sun Industry Standards Source License Version 1.1
+* =================================================
+* The contents of this file are subject to the Sun Industry Standards
+* Source License Version 1.1 (the "License"); You may not use this file
+* except in compliance with the License. You may obtain a copy of the
+* License at http://www.openoffice.org/license.html.
+*
+* Software provided under this License is provided on an "AS IS" basis,
+* WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+* WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+* See the License for the specific provisions governing your rights and
+* obligations concerning the Software.
+*
+* The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+*
+* Copyright: 2000 by Sun Microsystems, Inc.
+*
+* All Rights Reserved.
+*
+* Contributor(s): _______________________________________
+*
+*
+*
+**************************************************************************/
+
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// German (Germany) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// REGISTRY
+//
+
+IDR_BASIC REGISTRY DISCARDABLE "Basic.rgs"
+#endif // German (Germany) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""winres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "1 TYPELIB ""AxTestComponents.tlb""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "AxTestComponents Module\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "AxTestComponents\0"
+ VALUE "LegalCopyright", "Copyright 2000\0"
+ VALUE "OriginalFilename", "AxTestComponents.DLL\0"
+ VALUE "ProductName", "AxTestComponents Module\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ VALUE "OLESelfRegister", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROJNAME "AxTestComponents"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "AxTestComponents.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp
new file mode 100644
index 000000000000..3bff899ccc0e
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/Basic.cpp
@@ -0,0 +1,523 @@
+/*************************************************************************
+ *
+ * $RCSfile: Basic.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "stdafx.h"
+#include "AxTestComponents.h"
+#include "Basic.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CBasic
+
+
+STDMETHODIMP CBasic::inByte(unsigned char val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inByte: value= %d", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inShort(short val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inByte: value= %d", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inLong(long val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inLong: value= %d", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inString(BSTR val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inString: value= %S", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inFloat(float val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inFloat: value= %f", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inDouble(double val)
+{
+ USES_CONVERSION;
+ char buf[256];
+ sprintf( buf, "inDouble: value= %g", val);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inVariant(VARIANT val)
+{
+ USES_CONVERSION;
+ CComVariant var;
+ VariantCopyInd( &var, &val);
+ if( var.vt == VT_BSTR)
+ {
+ char buf[256];
+ sprintf( buf, "inVariant: value= %S", var.bstrVal);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ }
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inArray(LPSAFEARRAY val)
+{
+ HRESULT hr= S_OK;
+ long lbound= 0;
+
+ long ubound= 0;
+ hr= SafeArrayGetLBound( val, 1, &lbound);
+ hr= SafeArrayGetUBound( val, 1, &ubound);
+ long length= ubound - lbound +1;
+
+ CComVariant varElement;
+ char buf[4096];
+ ZeroMemory( buf, 10);
+ for( long i= 0; i < length ; i++)
+ {
+ varElement.Clear();
+ hr= SafeArrayGetElement( val, &i, &varElement);
+
+ if( varElement.vt == VT_BSTR)
+ { char bufTmp[256];
+ sprintf( bufTmp, " %d string: = %S \n", i, varElement.bstrVal);
+ strcat( buf, bufTmp);
+ }
+ }
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inObject(IDispatch *val)
+{
+ // We expect the object to be an AxTestComponent.Basic object
+ // with the property prpString set.
+ HRESULT hr= S_OK;
+ USES_CONVERSION;
+ char buf[256];
+ CComDispatchDriver disp( val);
+ CComBSTR bstr;
+ if( disp)
+ {
+ CComVariant var;
+ hr= disp.GetPropertyByName(L"prpString", &var);
+ if( var.vt== VT_BSTR)
+ bstr= var.bstrVal;
+ }
+ sprintf( buf, "inObject: value= %S", bstr.m_str);
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+
+ return S_OK;
+}
+
+
+
+STDMETHODIMP CBasic::inoutByte(unsigned char* val)
+{
+ *val+= 1;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutShort(short *val)
+{
+ *val+= 1;
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutLong(long *val)
+{
+ *val+= 1;
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutString(BSTR *val)
+{
+ MessageBoxW( NULL, *val, L"AxTestComponents.Basic", MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutFloat(float *val)
+{
+ *val+= 1;
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutDouble(double *val)
+{
+ *val+= 1;
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutVariant(VARIANT *val)
+{
+ if( val->vt & VT_BSTR)
+ {
+ MessageBoxW( NULL, val->bstrVal, L"AxTestComponents.Basic", MB_OK);
+ SysFreeString( val->bstrVal);
+ val->bstrVal= SysAllocString(L" a string from AxTestComponents.Basic");
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutArray(LPSAFEARRAY *val)
+{
+ inArray(*val);
+ SafeArrayDestroy(*val);
+ outArray( val);
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::inoutObject(IDispatch **val)
+{
+ inObject( *val);
+ outObject( val);
+ return S_OK;
+}
+
+
+
+STDMETHODIMP CBasic::outByte(unsigned char *val)
+{
+ *val= 111;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outShort(short *val)
+{
+ *val= 1111;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outLong(long *val)
+{
+ *val= 111111;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outString(BSTR *val)
+{
+ *val= SysAllocString(L" a string as out value");
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outFloat(float *val)
+{
+ *val= 3.14;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outDouble(double *val)
+{
+ *val= 3.145;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outVariant(VARIANT *val)
+{
+ val->vt = VT_BSTR;
+ val->bstrVal= SysAllocString(L"This is a string in a VARIANT");
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outArray(LPSAFEARRAY *val)
+{
+ HRESULT hr= S_OK;
+ SAFEARRAY* ar= SafeArrayCreateVector( VT_VARIANT, 0, 3);
+ CComVariant arStrings[3]; //BSTR arStrings[3];
+ arStrings[0].bstrVal= SysAllocString(L" out string 0");
+ arStrings[0].vt= VT_BSTR;
+ arStrings[1].bstrVal= SysAllocString( L"out string 1");
+ arStrings[1].vt= VT_BSTR;
+ arStrings[2].bstrVal= SysAllocString( L" outstring 2");
+ arStrings[2].vt= VT_BSTR;
+ for( long i= 0; i < 3; i++)
+ {
+ SafeArrayPutElement( ar, &i, (void*) &arStrings[i]);
+ }
+ *val= ar;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::outObject(IDispatch* *val)
+{
+ HRESULT hr= S_OK;
+ CComPtr< IUnknown > spUnk;
+ hr= spUnk.CoCreateInstance(L"AxTestComponents.Basic");
+ CComDispatchDriver disp( spUnk);
+ CComVariant varVal( L"This is the property prp String");
+ hr= disp.PutPropertyByName( L"prpString", &varVal);
+ *val= disp;
+ (*val)->AddRef();
+ return S_OK;
+}
+
+
+
+
+STDMETHODIMP CBasic::get_prpByte(unsigned char *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpByte(unsigned char newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpShort(short *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpShort(short newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpLong(long *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpLong(long newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpString(BSTR *pVal)
+{
+ m_bstrPrpString.CopyTo( pVal );
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpString(BSTR newVal)
+{
+ m_bstrPrpString= newVal;
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpFloat(float *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpFloat(float newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpDouble(double *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpDouble(double newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpVariant(VARIANT *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpVariant(VARIANT newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpArray(LPSAFEARRAY *pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpArray(LPSAFEARRAY newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::get_prpObject(IDispatch **pVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::put_prpObject(IDispatch *newVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CBasic::mixed1(
+ /* [in] */ unsigned char aChar,
+ /* [out] */ unsigned char __RPC_FAR *outChar,
+ /* [out][in] */ unsigned char __RPC_FAR *inoutChar,
+ /* [in] */ VARIANT var,
+ /* [out] */ VARIANT __RPC_FAR *outVar,
+ /* [out][in] */ VARIANT __RPC_FAR *inoutVar,
+ /* [in] */ SAFEARRAY __RPC_FAR * ar,
+ /* [out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *outAr,
+ /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *inoutAr,
+ /* [in] */ IDispatch __RPC_FAR *disp,
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *outDisp,
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *inoutDisp)
+{
+ HRESULT hr= S_OK;
+ inByte( aChar);
+ outByte( outChar);
+ inoutByte( inoutChar);
+ inVariant( var);
+ outVariant( outVar);
+ inoutVariant( inoutVar);
+ inArray( ar);
+ outArray( outAr);
+ inoutArray( inoutAr);
+ inObject( disp);
+ outObject( outDisp);
+ inoutObject( inoutDisp);
+ return hr;
+}
+
+
+
+
+// VT_UI1
+
+STDMETHODIMP CBasic::inSequenceLong(LPSAFEARRAY val)
+{
+ HRESULT hr= S_OK;
+ long lbound=0;
+ long ubound= 0;
+ hr= SafeArrayGetLBound( val, 1, &lbound);
+ hr= SafeArrayGetUBound( val, 1, &ubound);
+ long length= ubound - lbound +1;
+
+ CComVariant varElement;
+ char buf[4096];
+ ZeroMemory( buf, 10);
+ for( long i= 0; i < length ; i++)
+ {
+ varElement.Clear();
+ hr= SafeArrayGetElement( val, &i, &varElement);
+
+ if( varElement.vt == VT_BSTR)
+ { char bufTmp[256];
+ sprintf( bufTmp, " %d string: = %d \n", i, varElement.lVal);
+ strcat( buf, bufTmp);
+ }
+ }
+ MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK);
+
+ return S_OK;
+}
diff --git a/extensions/test/ole/AxTestComponents/Basic.h b/extensions/test/ole/AxTestComponents/Basic.h
new file mode 100644
index 000000000000..97707ea7f246
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/Basic.h
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: Basic.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Basic.h : Declaration of the CBasic
+
+#ifndef __BASIC_H_
+#define __BASIC_H_
+
+#include "resource.h" // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CBasic
+class ATL_NO_VTABLE CBasic :
+ public CComObjectRootEx<CComSingleThreadModel>,
+ public CComCoClass<CBasic, &CLSID_Basic>,
+ public IDispatchImpl<IBasic, &IID_IBasic, &LIBID_AXTESTCOMPONENTSLib>
+{
+public:
+ CBasic()
+ {
+ }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_BASIC)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CBasic)
+ COM_INTERFACE_ENTRY(IBasic)
+ COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// IBasic
+public:
+ STDMETHOD(inSequenceLong)(LPSAFEARRAY ar);
+ STDMETHOD(mixed1)(
+ /* [in] */ unsigned char aChar,
+ /* [out] */ unsigned char __RPC_FAR *outChar,
+ /* [out][in] */ unsigned char __RPC_FAR *inoutChar,
+ /* [in] */ VARIANT var,
+ /* [out] */ VARIANT __RPC_FAR *outVar,
+ /* [out][in] */ VARIANT __RPC_FAR *inoutVar,
+ /* [in] */ SAFEARRAY __RPC_FAR * ar,
+ /* [out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *outAr,
+ /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *inoutAr,
+ /* [in] */ IDispatch __RPC_FAR *disp,
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *outDisp,
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *inoutDisp) ;
+
+ STDMETHOD(get_prpObject)(/*[out, retval]*/ IDispatch* *pVal);
+ STDMETHOD(put_prpObject)(/*[in]*/ IDispatch* newVal);
+ STDMETHOD(get_prpArray)(/*[out, retval]*/ LPSAFEARRAY *pVal);
+ STDMETHOD(put_prpArray)(/*[in]*/ LPSAFEARRAY newVal);
+ STDMETHOD(get_prpVariant)(/*[out, retval]*/ VARIANT *pVal);
+ STDMETHOD(put_prpVariant)(/*[in]*/ VARIANT newVal);
+ STDMETHOD(get_prpDouble)(/*[out, retval]*/ double *pVal);
+ STDMETHOD(put_prpDouble)(/*[in]*/ double newVal);
+ STDMETHOD(get_prpFloat)(/*[out, retval]*/ float *pVal);
+ STDMETHOD(put_prpFloat)(/*[in]*/ float newVal);
+ STDMETHOD(get_prpString)(/*[out, retval]*/ BSTR *pVal);
+ STDMETHOD(put_prpString)(/*[in]*/ BSTR newVal);
+ STDMETHOD(get_prpLong)(/*[out, retval]*/ long *pVal);
+ STDMETHOD(put_prpLong)(/*[in]*/ long newVal);
+ STDMETHOD(get_prpShort)(/*[out, retval]*/ short *pVal);
+ STDMETHOD(put_prpShort)(/*[in]*/ short newVal);
+ STDMETHOD(get_prpByte)(/*[out, retval]*/ unsigned char *pVal);
+ STDMETHOD(put_prpByte)(/*[in]*/ unsigned char newVal);
+
+ STDMETHOD(outObject)(/*[out]*/ IDispatch* *val);
+ STDMETHOD(outArray)(/*[out]*/ LPSAFEARRAY * val);
+ STDMETHOD(outVariant)(/*[out]*/ VARIANT* val);
+ STDMETHOD(outDouble)(/*[out]*/ double* val);
+ STDMETHOD(outFloat)(/*[out]*/ float* val);
+ STDMETHOD(outString)(/*[out]*/ BSTR* val);
+ STDMETHOD(outLong)(/*[out]*/ long* val);
+ STDMETHOD(outShort)(/*[out]*/ short* val);
+ STDMETHOD(outByte)(/*[out]*/ unsigned char* val);
+
+ STDMETHOD(inoutObject)(/*[in,out]*/ IDispatch* *val);
+ STDMETHOD(inoutArray)(/*[in,out]*/ LPSAFEARRAY * val);
+ STDMETHOD(inoutVariant)(/*[in,out]*/ VARIANT * val);
+ STDMETHOD(inoutDouble)(/*[in,out]*/ double * val);
+ STDMETHOD(inoutFloat)(/*[in,out]*/ float * val);
+ STDMETHOD(inoutString)(/*[in, out]*/ BSTR* val);
+ STDMETHOD(inoutLong)(/*[in,out]*/ long * val);
+ STDMETHOD(inoutShort)(/*[in,out]*/ short* val);
+ STDMETHOD(inoutByte)(/*[in,out]*/ unsigned char* val);
+
+ STDMETHOD(inObject)(/*[in]*/ IDispatch* val);
+ STDMETHOD(inArray)(/*[in]*/ LPSAFEARRAY val);
+ STDMETHOD(inVariant)(/*[in]*/ VARIANT val);
+ STDMETHOD(inDouble)(/*[in]*/ double val);
+ STDMETHOD(inFloat)(/*[in]*/ float val);
+ STDMETHOD(inString)(/*[in]*/ BSTR val);
+ STDMETHOD(inLong)(/*[in]*/ long val);
+ STDMETHOD(inShort)(/*[in]*/ short val);
+ STDMETHOD(inByte)(/*[in]*/ unsigned char val);
+
+
+ CComBSTR m_bstrPrpString;
+};
+
+#endif //__BASIC_H_
+
diff --git a/extensions/test/ole/AxTestComponents/Basic.rgs b/extensions/test/ole/AxTestComponents/Basic.rgs
new file mode 100644
index 000000000000..97dee4860ac7
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/Basic.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ AxTestComponents.Basic.1 = s 'Basic Class'
+ {
+ CLSID = s '{BFE10EBE-8584-11D4-8335-005004526AB4}'
+ }
+ AxTestComponents.Basic = s 'Basic Class'
+ {
+ CLSID = s '{BFE10EBE-8584-11D4-8335-005004526AB4}'
+ CurVer = s 'AxTestComponents.Basic.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {BFE10EBE-8584-11D4-8335-005004526AB4} = s 'Basic Class'
+ {
+ ProgID = s 'AxTestComponents.Basic.1'
+ VersionIndependentProgID = s 'AxTestComponents.Basic'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{BFE10EB1-8584-11D4-8335-005004526AB4}'
+ }
+ }
+}
diff --git a/extensions/test/ole/AxTestComponents/StdAfx.cpp b/extensions/test/ole/AxTestComponents/StdAfx.cpp
new file mode 100644
index 000000000000..537d9fdc930f
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/StdAfx.cpp
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/extensions/test/ole/AxTestComponents/StdAfx.h b/extensions/test/ole/AxTestComponents/StdAfx.h
new file mode 100644
index 000000000000..3bfa08622668
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/StdAfx.h
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__BFE10EB4_8584_11D4_8335_005004526AB4__INCLUDED_)
+#define AFX_STDAFX_H__BFE10EB4_8584_11D4_8335_005004526AB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__BFE10EB4_8584_11D4_8335_005004526AB4__INCLUDED)
diff --git a/extensions/test/ole/AxTestComponents/resource.h b/extensions/test/ole/AxTestComponents/resource.h
new file mode 100644
index 000000000000..cdb1b27b8ef3
--- /dev/null
+++ b/extensions/test/ole/AxTestComponents/resource.h
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: resource.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by AxTestComponents.rc
+//
+#define IDS_PROJNAME 100
+#define IDR_BASIC 101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 201
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 201
+#define _APS_NEXT_SYMED_VALUE 102
+#endif
+#endif
diff --git a/extensions/test/ole/JScriptNewStyle.htm b/extensions/test/ole/JScriptNewStyle.htm
new file mode 100644
index 000000000000..d2b061d7513e
--- /dev/null
+++ b/extensions/test/ole/JScriptNewStyle.htm
@@ -0,0 +1,1039 @@
+<HTML>
+<HEAD>
+<META NAME="GENERATOR" Content="Microsoft Developer Studio">
+<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
+<TITLE>Document Title</TITLE>
+</HEAD>
+<BODY id=theBody>
+
+<script language="JScript">
+function callOleTest( id)
+{
+ var factory= new ActiveXObject("com.sun.star.ServiceManager");
+ var oletest= factory.createInstance("oletest.OleTest");
+// alert(oletest);
+
+ var arr= new Array( 1, 2, 3, 4, 0);
+ var arrDouble= new Array( 1.2345, 12.345, 123,45, 1234.5, 12345);
+ var arrBool= new Array( 1, 0, 2, 0, 3);
+ var arrChar= new Array( '1', 'A', "1", "A", ' ', 55, 56);
+ var arrString= new Array("hamburger","cheeseburger", "chicken nuggets", "chicken wings" , "pizza");
+ var arrAny= new Array( 100, 100.1235,"hallo");
+ var arrSeq= new Array( arr, arr, arr);
+ var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
+
+// var ob= new Object();
+// ob.value= "A JScript object";
+// var arrObject= new Array( ob, ob, ob);
+
+
+ var arrout1= new Array();
+ var arrout2= new Array();
+ var arrout3= new Array();
+
+ var ret, i;
+ var sfarray, sfarray1, sfarray2, sfarray3;
+ var value= oletest._GetValueObject();
+ var outValue= oletest._GetValueObject();
+ outValue.InitOutParam();
+ var outValue2= oletest._GetValueObject();
+ outValue2.InitOutParam();
+ var outValue3= oletest._GetValueObject();
+ outValue3.InitOutParam();
+
+ var inoutValue= oletest._GetValueObject();
+// inoutValue.InitInOutParam();
+
+ switch( id)
+ {
+ // Array in-params
+ case 1:
+ value.Set("[]byte", arr)
+ ret= oletest.methodByte( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() + "<br>");
+ document.writeln( "Returns a Sequence&lt BYTE &gt <br>" + sfarray.toArray()) ; break;
+
+ case 2:
+ value.Set("[]double", arrDouble)
+ ret= oletest.methodDouble( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrDouble.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt double &gt <br>" + sfarray.toArray()) ; break;
+
+ case 3:
+ value.Set("[]boolean", arrBool)
+ ret= oletest.methodBool( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrBool.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt BOOL &gt <br>" + sfarray.toArray()) ; break;
+
+ case 4:
+ value.Set("[]short", arr)
+ ret= oletest.methodShort( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt SHORT &gt <br>" + sfarray.toArray()) ; break;
+
+ case 5:
+ value.Set("[]unsigned short", arr)
+ ret= oletest.methodUShort( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt unsigned SHORT &gt <br>" + sfarray.toArray()) ; break;
+
+ case 6:
+ value.Set("[]long", arr)
+ ret= oletest.methodLong( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt LONG &gt <br>" + sfarray.toArray()) ; break;
+
+ case 7:
+ value.Set("[]unsigned long", arr)
+ ret= oletest.methodULong( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt unsigned LONG &gt <br>" + sfarray.toArray()) ; break;
+
+ case 8:
+ value.Set("[]char", arrChar)
+ ret= oletest.methodChar( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrChar.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt wchar_t &gt <br>" + sfarray.toArray()) ; break;
+
+ case 9:
+ value.Set("[]string", arrString)
+ ret= oletest.methodString( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrString.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt UString &gt <br>" + sfarray.toArray()) ; break;
+
+ case 10:
+ value.Set("[]any", arrAny)
+ ret= oletest.methodAny( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrAny.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt UsrAny &gt <br>" + sfarray.toArray() ) ; break;
+
+ case 11:
+ var allArray= new Array();
+ for(var i= 0; i <3; i++)
+ {
+ var value1= oletest._GetValueObject();
+ value1.Set("[]long", arr);
+ allArray[i]= value1;
+ }
+
+ value.Set("[][]long", allArray);
+
+ ret= oletest.methodSequence( value);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrSeq.toString() +"<br>");
+ document.writeln("Returns a Sequence&lt Sequence &lt long &gt&gt <br>") ;
+ var arr1= new Array();
+ arr1= sfarray.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ var arr2= new Array();
+ arr2= sfarray2.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+
+ case 12:
+ var array1= new Array();
+ for(var i= 0; i <3; i++)
+ {
+ var array2 = new Array();
+ for( var j= 0; j < 3; j++)
+ {
+ var value2= oletest._GetValueObject();
+ value2.Set("[]long", arr);
+ array2[j]= value2;
+ }
+
+ var value1= oletest._GetValueObject();
+ value1.Set("[][]long", array2)
+ array1[i]= value1;
+ }
+ var valueAll= oletest._GetValueObject();
+ valueAll.Set("[][][]long",array1);
+
+ ret= oletest.methodSequence2( valueAll);
+ document.writeln( "Param: " + arrSeq2.toString() +"<br>");
+ sfarray1= new VBArray( ret);
+ arr1= sfarray1.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ arr2= sfarray2.toArray();
+
+ for ( j=0; j < arr2.length; j++)
+ {
+ sfarray3= new VBArray( arr2[j]);
+ arr3= sfarray3.toArray();
+ document.write( i+ " ");
+ document.writeln(j + ": "+ arr3.toString() + "<br>" );
+ }
+
+ }
+ break;
+
+ case 13:
+
+ var ar= new Array();
+ for( i=0; i< 3; i++)
+ {
+ var ob= new Object();
+ var valueObject= oletest._GetValueObject();
+ ob.value= "A JScript object!";
+ valueObject.Set("com.sun.star.uno.XInterface", ob);
+// valueObject.Set("long", 5);
+ ar[i]= valueObject;
+ }
+ value.Set("[]com.sun.star.uno.XInterface", ar);
+// value.Set("[]long", ar);
+
+ ret = oletest.methodXInterface( value);
+ sfarray= new VBArray( ret);
+ var arRet= sfarray.toArray();
+
+ document.writeln( "Params : Array containing objects ")
+ for( index in ar)
+ {
+ document.writeln( "object " + index + ": " + ar[index].Get().value +" ");
+ }
+ document.writeln( "<br>" ) ;
+ document.writeln("Return: <br>");
+ for( index in arRet)
+ {
+ document.writeln( "object " + index + ": " + arRet[index].value + " ");
+ }
+ break;
+
+
+
+
+ // Properties: setting and getting values
+ case 200:
+ value.Set("[]byte", arr)
+ oletest.AttrByte = value;
+ ret= oletest.AttrByte;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrByte: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrByte: " + sfarray.toArray()); break;
+
+ case 201:
+ value.Set("[]double", arrDouble)
+ oletest.AttrDouble= value;
+ ret= oletest.AttrDouble;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrDouble: " + arrDouble.toString() + "<p>");
+ document.writeln("Getting AttrDouble: " + sfarray.toArray()); break;
+
+ case 202:
+ value.Set("[]boolean", arrBool)
+ oletest.AttrBool= value;
+ ret= oletest.AttrBool;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrBool: " + arrBool.toString() + "<p>");
+ document.writeln("Getting AttrBool: " + sfarray.toArray()); break;
+
+ case 203:
+ value.Set("[]short", arr)
+ oletest.AttrShort= value;
+ ret= oletest.AttrShort;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrShort: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrShort: " + sfarray.toArray()); break;
+
+ case 204:
+ value.Set("[]unsigned short", arr)
+ oletest.AttrUShort= value;
+ ret= oletest.AttrUShort;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrUShort: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrUShort: " + sfarray.toArray()); break;
+
+ case 205:
+ value.Set("[]long", arr)
+ oletest.AttrLong= value;
+ ret= oletest.AttrLong;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrLong: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrLong: " + sfarray.toArray()); break;
+
+ case 206:
+ value.Set("[]unsigned long", arr)
+ oletest.AttrULong= value;
+ ret= oletest.AttrULong;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrULong: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrULong: " + sfarray.toArray()); break;
+
+ case 207:
+ value.Set("[]char", arrChar)
+ oletest.AttrChar= value;
+ ret= oletest.AttrChar;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrChar: " + arrChar.toString() + "<p>");
+ document.writeln("Getting AttrChar: " + sfarray.toArray()); break;
+
+ case 208:
+ value.Set("[]string", arrString)
+ oletest.AttrString= value;
+ ret= oletest.AttrString;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrString: " + arrString.toString() + "<p>");
+ document.writeln("Getting AttrString: " + sfarray.toArray()); break;
+
+ case 209:
+ value.Set("[]any", arrAny)
+ oletest.AttrAny= value;
+ ret= oletest.AttrAny;
+ sfarray= new VBArray( ret);
+ document.writeln("Setting AttrAny: " + arrAny.toString() + "<p>");
+ document.writeln("Getting AttrAny: " + sfarray.toArray()); break;
+
+ case 210:
+ var allArray= new Array();
+ for(var i= 0; i <3; i++)
+ {
+ var value1= oletest._GetValueObject();
+ value1.Set("[]long", arr);
+ allArray[i]= value1;
+ }
+
+ value.Set("[][]long", allArray);
+
+ oletest.AttrSequence= value;
+ ret= oletest.AttrSequence;
+ sfarray= new VBArray( ret);
+
+ document.writeln( "Param: " + arrSeq.toString() +"<br>");
+ document.writeln("Returns a Sequence&lt Sequence &lt long &gt&gt <br>") ;
+ var arr1= new Array();
+ arr1= sfarray.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ var arr2= new Array();
+ arr2= sfarray2.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+
+ case 211:
+ var array1= new Array();
+ for(var i= 0; i <3; i++)
+ {
+ var array2 = new Array();
+ for( var j= 0; j < 3; j++)
+ {
+ var value2= oletest._GetValueObject();
+ value2.Set("[]long", arr);
+ array2[j]= value2;
+ }
+
+ var value1= oletest._GetValueObject();
+ value1.Set("[][]long", array2)
+ array1[i]= value1;
+ }
+ var valueAll= oletest._GetValueObject();
+ valueAll.Set("[][][]long",array1);
+
+ oletest.AttrSequence2= valueAll;
+ ret= oletest.AttrSequence2;
+ sfarray1= new VBArray( ret);
+ arr1= sfarray1.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ arr2= sfarray2.toArray();
+
+ for ( j=0; j < arr2.length; j++)
+ {
+ sfarray3= new VBArray( arr2[j]);
+ arr3= sfarray3.toArray();
+ document.write( i+ " ");
+ document.writeln(j + ": "+ arr3.toString() + "<br>" );
+ }
+
+ }
+ break;
+
+ case 212:
+ var ar= new Array();
+ for( i=0; i< 3; i++)
+ {
+ var ob= new Object();
+ var valueObject= oletest._GetValueObject();
+ ob.value= "A JScript object!";
+ valueObject.Set("com.sun.star.uno.XInterface", ob);
+ ar[i]= valueObject;
+ }
+ value.Set("[]com.sun.star.uno.XInterface", ar);
+
+ oletest.AttrXInterface= value;
+ ret= oletest.AttrXInterface;
+ sfarray= new VBArray( ret);
+ var arRet= sfarray.toArray();
+
+ document.writeln( "Params : Array containing objects ")
+ for( index in ar)
+ {
+ document.writeln( "object " + index + ": " + ar[index].Get().value +" ");
+ }
+ document.writeln( "<br>" ) ;
+ document.writeln("Return: <br>");
+ for( index in arRet)
+ {
+ document.writeln( "object " + index + ": " + arRet[index].value + " ");
+ }
+
+ break;
+
+ // Out-parameter ------------------------------------------------------------
+ case (2000):
+
+ oletest.testout_methodByte( outValue );
+ alert("byte: " + outValue.Get() ); break;
+ case (2001):
+ oletest.testout_methodDouble( outValue );
+ alert( "double: " + outValue.Get() ); break;
+ case (2002):
+ oletest.testout_methodBool( outValue );
+ alert( "boolean: " + outValue.Get() ); break;
+ case (2003):
+ oletest.testout_methodShort( outValue );
+ alert( "short: " + outValue.Get() ); break;
+ case (2004):
+ oletest.testout_methodUShort( outValue );
+ alert( "unsigned short: " + outValue.Get() ); break;
+ case (2005):
+ oletest.testout_methodLong( outValue );
+ alert( "long: " + outValue.Get() ); break;
+ case (2006):
+ oletest.testout_methodULong( outValue );
+ alert( "unsigned long: " + outValue.Get() ); break;
+ case (2007):
+ oletest.testout_methodChar( outValue );
+ alert( "char: " + outValue.Get() ); break;
+ case (2008):
+ oletest.testout_methodString( outValue );
+ alert( "string: " + outValue.Get()); break;
+ case (2009):
+ oletest.testout_methodAny( outValue );
+ alert( "any: " + outValue.Get() ); break;
+ case (2010):
+ oletest.testout_methodSequence( outValue );
+ var sfarray= new VBArray( outValue.Get());
+ arr= sfarray.toArray();
+ document.writeln("use the browser's back arrow to go to the previous page <p>");
+ document.writeln( arr.toString());
+ break;
+ case (2011):
+ oletest.testout_methodSequence2( outValue );
+ var sfarray= new VBArray( outValue.Get());
+ arr= sfarray.toArray();
+ var i;
+ for( i=0; i < arr.length; i++)
+ {
+ var sfarray= new VBArray( arr[i]);
+ var arr2= new Array();
+ arr2= sfarray.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+ case (2012):
+ oletest.testout_methodMulParams1( outValue, outValue2 );
+ document.writeln( "int : " + outValue.Get() + " int :" + outValue2.Get()); break;
+ case (2013):
+ oletest.testout_methodMulParams2( outValue, outValue2, outValue3 );
+ document.writeln( "int: " + outValue.Get() + " int: " + outValue2.Get() + " string: " + outValue3.Get() ); break;
+ case (2014):
+ oletest.testout_methodMulParams3( "hallo", outValue );
+ document.writeln( "string: " + outValue.Get() ); break;
+ case (2015):
+ oletest.testout_methodXInterface( outValue );
+ var out= outValue.Get();
+ document.writeln( "string: " + out.AttrAny2); break;
+
+ // INOUT - Parameter -------------------------------------------------------------------------------
+ // The in value has to be placed on index 0 of the passed in array
+ case (500):
+ inoutValue.InitInOutParam("byte", 100);
+ oletest.testinout_methodByte( inoutValue );
+ alert("byte: " + inoutValue.Get() ); break;
+ case (501):
+ inoutValue.InitInOutParam("double", 3.14);
+ oletest.testinout_methodDouble( inoutValue );
+ alert( "double: " + inoutValue.Get() ); break;
+ case (502):
+ inoutValue.InitInOutParam("boolean", false);
+ oletest.testinout_methodBool( inoutValue );
+ alert( "boolean: " + inoutValue.Get() ); break;
+ case (503):
+ inoutValue.InitInOutParam( "short", 200);
+ oletest.testinout_methodShort( inoutValue );
+ alert( "short: " + inoutValue.Get() ); break;
+ case (504):
+ inoutValue.InitInOutParam("unsigned short", 300);
+ oletest.testinout_methodUShort( inoutValue );
+ alert( "unsigned short: " + inoutValue.Get() ); break;
+ case (505):
+ inoutValue.InitInOutParam("long", 400);
+ oletest.testinout_methodLong( inoutValue );
+ alert( "long: " + inoutValue.Get() ); break;
+ case (506):
+ inoutValue.InitInOutParam( "unsigned long", 500);
+ oletest.testinout_methodULong( inoutValue );
+ alert( "unsigned long: " + inoutValue.Get() ); break;
+ case (507):
+ inoutValue.InitInOutParam( "char", "A");
+ oletest.testinout_methodChar( inoutValue );
+ alert( "char: " + inoutValue.Get() ); break;
+ case (508):
+ inoutValue.InitInOutParam("string", "I am a string");
+ oletest.testinout_methodString( inoutValue );
+ alert( "string: " + inoutValue.Get() ); break;
+ case (509):
+ inoutValue.InitInOutParam("[]long", arr);
+ oletest.testinout_methodAny( inoutValue ); // the method simply returns the argument
+ sfarray= new VBArray( inoutValue.Get());
+ arr= sfarray.toArray();
+ alert( "any: " + arr.toString() ); break;
+ case (510):
+ inoutValue.InitInOutParam("[]long", arr);
+ oletest.testinout_methodSequence( inoutValue );
+ var sfarray= new VBArray( inoutValue.Get());
+ arr= sfarray.toArray();
+ document.writeln("use the browser's back arrow to go to the previous page <p>");
+ document.writeln( arr.toString());
+ break;
+ case (511):
+ inoutValue.InitInOutParam( "[][]long", arrSeq);
+ oletest.testinout_methodSequence2( inoutValue );
+ var sfarray= new VBArray( inoutValue.Get());
+ arr= sfarray.toArray();
+ var i;
+ for( i=0; i < arr.length; i++)
+ {
+ var sfarray= new VBArray( arr[i]);
+ var arr2= new Array();
+ arr2= sfarray.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+ case 512:
+ var ob= new Object();
+ ob.value= "this is a string";
+ inoutValue.InitInOutParam( "com.sun.star.script.XInvocation", ob);
+ oletest.testinout_methodXInterface( inoutValue);
+ document.write("Out value: " + inoutValue.Get().value );
+ break;
+
+
+
+
+
+ // Test ANY
+ // Methods
+ case 1000:
+ i= 100;
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1001:
+ i= 3.14;
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1002:
+ i= "Hallo"
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1003:
+ i= arr;
+ ret= oletest.methodAnyTest1( i);
+ sfarray= new VBArray( ret);
+ document.writeln( "in: " + i + " ret: " + sfarray.toArray());
+ break;
+ case 1004:
+ var obj= new Object();
+ obj[1]= "This is index 0";
+ ret= oletest.methodAnyTest1( obj);
+ document.writeln( "in: " + obj + " ret: " + ret);
+ break;
+
+
+ // Test ANY property
+ case 1010:
+ i= 100;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1011:
+ i= 3.14;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1012:
+ i= "Hallo"
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1013:
+ i= arr;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ sfarray= new VBArray( ret);
+ document.writeln( "set: " + i + " get: " + sfarray.toArray());
+ break;
+ case 1014:
+ var obj= new Object();
+ obj[1]= "This is index 0";
+ oletest.AttrAny2= obj;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + obj + " get: " + ret);
+ break;
+
+
+ case 2100:
+ alert("2100");
+ var ret= oletest.retMethodByte();
+ var sfarray= VBArray( ret);
+ document.writeln( sfarray.toArray() );
+ break;
+
+
+// case 5000:
+// oletest.other_methodAnyIn("hallo");
+
+
+
+ }
+
+}
+
+function funcOut( out)
+{
+ out["du"]= 0xffff;
+}
+
+</script>
+
+<script language="VBScript">
+
+sub callBasic(id)
+
+ Dim factory
+ Set factory= GetObject("", "com.sun.star.ServiceManager")
+
+ Set oletest= factory.createInstance("oletest.OleTest")
+
+
+ arrInt= Array(1,2,3,4,5)
+ arrInt2= Array( -1, -2, 127, 128, 0)
+ arrDouble= Array(1.1, 2.2, 3.3, 4.4, 5.5)
+ arrBool= Array(0,1,0,2,0)
+ arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
+ arrString= Array("Chicken Wings", "Cheeseburger", "Hamburger")
+ arrChar= Array("a",65, "M")
+ arrAny= Array("Mickey", 3.14, 100, "A")
+
+ Dim arrDim2Int(1,1)
+ For i= 0 To 1
+ For j= 0 To 1
+ arrDim2Int(i,j) = i*2 + j
+ Next
+ Next
+
+ Dim arrDim3Int(1,1,1)
+ For i= 0 To 1
+ For j= 0 To 1
+ For k=0 To 1
+ arrDim3Int(i,j,k) = i*2 + j*2 + k
+ Next
+ Next
+ Next
+
+
+ select case id
+ case 0
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodByte(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 1
+ document.writeln "param: "
+ printArray arrDouble
+ ret= oletest.methodDouble(arrDouble)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 2
+ document.writeln "param: "
+ printArray arrBool
+ ret= oletest.methodBool(arrBool)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 3
+ document.writeln "param: "
+ printArray arrInt2
+ ret= oletest.methodShort(arrInt2)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 4
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodUShort(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 5
+ document.writeln "param: "
+ printArray arrLong
+ ret= oletest.methodLong(arrLong)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 6
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodULong(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 7
+ document.writeln "param: "
+ printArray arrString
+ ret= oletest.methodString(arrString)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 8
+ document.writeln "param: "
+ printArray arrChar
+ ret= oletest.methodChar(arrChar)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 9
+ document.writeln "param: "
+ printArray arrAny
+ ret= oletest.methodAny(arrAny)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 10
+ document.writeln "param: "
+ printArray2 arrDim2Int
+ ret= oletest.methodSequence(arrDim2Int)
+ document.writeln "<br> return value: "
+ for each val in ret
+ document.write "<br> array: "
+ for each val2 in val
+ document.write val2
+ next
+ next
+
+ // In Out Parameter --------------------------------------------------
+ case 100
+ a= 100
+ document.write "param: " & CStr( a) & "<br>"
+ oletest.testinout_methodByte a
+ document.write a
+ case 101
+ a= 1.11
+ document.write "param: " & CStr( a) & "<br>"
+ oletest.testinout_methodDouble a
+ document.write a
+ case 102
+ a= 5
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodBool a
+ document.write a
+ case 103
+ a= -10
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodShort a
+ document.write a
+ case 104
+ a= 128
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodUShort a
+ document.write a
+ case 105
+ a= 65556
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodLong a
+ document.write a
+ case 106
+ a= 65556
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodULong a
+ document.write a
+ case 107
+ a= "ein test string"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodString a
+ document.write a
+ case 108
+ a= "W"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodChar a
+ document.write a
+ case 109
+ a= "Ein String im Any"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.other_methodAnyIn a
+ document.write a
+// Attributes -----------------------------------------------------------------
+ case 200
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrByte= arrInt
+ b= oletest.AttrByte
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 201
+ document.write "set: "
+ printArray arrDouble
+ oletest.AttrDouble= arrDouble
+ b= oletest.AttrDouble
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 202
+ document.write "set: "
+ printArray arrBool :
+ oletest.AttrBool= arrBool
+ b= oletest.AttrBool
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 203
+ document.write "set: "
+ printArray arrInt2 :
+ oletest.AttrShort= arrInt2
+ b= oletest.AttrShort
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 204
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrUShort= arrInt
+ b= oletest.AttrUShort
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 205
+ document.write "set: "
+ printArray arrInt2
+ oletest.AttrLong= arrInt2
+ b= oletest.AttrLong
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 206
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrULong= arrInt
+ b= oletest.AttrULong
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 207
+ document.write "set: "
+ printArray arrString
+ oletest.AttrString= arrString
+ b= oletest.AttrString
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 208
+ document.write "set: "
+ printArray arrChar
+ oletest.AttrChar= arrChar
+ b= oletest.AttrChar
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 209
+ document.write "set: "
+ printArray arrAny
+ oletest.AttrAny= arrAny
+ b= oletest.AttrAny
+ call printArrayEx( "<br> get: ", "<br>", b)
+
+ case 210
+ document.write "set: <br>"
+ printArray2 arrDim2Int :
+ oletest.AttrSequence= arrDim2Int
+ ret= oletest.AttrSequence
+ document.write "get: "
+ for each val in ret
+ document.write "<br> array: "
+ for each val2 in val
+ document.write val2
+ next
+ next
+
+ end select
+end sub
+sub printArray( arr)
+ document.write "array: "
+ For Each val In arr
+ document.write CStr(val) & " "
+ Next
+end sub
+
+// print a 2 dimensional Array
+
+sub printArray2( arr)
+ elements1= UBound( arr, 1) - LBound( arr, 1) +1
+ elements2= UBound( arr, 2) - LBound( arr, 2) +1
+
+ For i=0 To elements1 -1
+ document.write( "array " & CStr( i) & ": " )
+ For j=0 To elements2 -1
+ document.write CStr( arr(i,j))
+ Next
+ document.write( "<br>")
+ Next
+end sub
+
+sub printArrayEx( pre, post, array)
+ document.write pre
+ printArray array
+ document.write post
+end sub
+</script>
+
+<div id=out> </div>
+
+<!-- Insert HTML here -->
+
+<h2> JScript with _GetValueObject </h2>
+Tests Array/Sequence conversion.<br>
+All methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
+<br>
+<button onclick='callOleTest( 1)'>byte</Button>
+<button onclick='callOleTest( 2)'>double</Button>
+<button onclick='callOleTest( 3)'>boolean</Button>
+<button onclick='callOleTest( 4)'>short</Button>
+<button onclick='callOleTest( 5)'>unsigned short</Button>
+<button onclick='callOleTest( 6)'>long</Button>
+<button onclick='callOleTest( 7)'>unsigned long</Button>
+<button onclick='callOleTest( 8)'>char</Button>
+<button onclick='callOleTest( 10)'>any</Button>
+<button onclick='callOleTest( 11)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 12)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 13)'>XInterface</Button>
+<p>
+
+<p>
+Out Parameter <br>
+<button onclick='callOleTest( 2000)'>byte </Button>
+<button onclick='callOleTest( 2001)'>double</Button>
+<button onclick='callOleTest( 2002)'>boolean</Button>
+<button onclick='callOleTest( 2003)'>short</Button>
+<button onclick='callOleTest( 2004)'>unsigned short</Button>
+<button onclick='callOleTest( 2005)'>long</Button>
+<button onclick='callOleTest( 2006)'>unsigned long</Button>
+<button onclick='callOleTest( 2007)'>char</Button>
+<button onclick='callOleTest( 2008)'>string</Button>
+<button onclick='callOleTest( 2009)'>any</Button>
+<button onclick='callOleTest( 2010)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 2011)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 2012)'>2 out </Button>
+<button onclick='callOleTest( 2013)'>3 out </Button>
+<button onclick='callOleTest( 2014)'>1 in & 1 out </Button>
+<button onclick='callOleTest( 2015)'>XInterface </Button>
+
+<p>
+In Out Parameter <br>
+<button onclick='callOleTest( 500)'>byte </Button>
+<button onclick='callOleTest( 501)'>double</Button>
+<button onclick='callOleTest( 502)'>boolean</Button>
+<button onclick='callOleTest( 503)'>short</Button>
+<button onclick='callOleTest( 504)'>unsigned short</Button>
+<button onclick='callOleTest( 505)'>long</Button>
+<button onclick='callOleTest( 506)'>unsigned long</Button>
+<button onclick='callOleTest( 507)'>char</Button>
+<button onclick='callOleTest( 508)'>string</Button>
+<button onclick='callOleTest( 509)'>any</Button>
+<button onclick='callOleTest( 510)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 511)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 512)'>XInterface </Button>
+<p>
+
+Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
+ the element type of the Sequence is written on the buttons. <br>
+<button onclick='callOleTest( 200)'>byte </Button>
+<button onclick='callOleTest( 201)'>double</Button>
+<button onclick='callOleTest( 202)'>boolean</Button>
+<button onclick='callOleTest( 203)'>short</Button>
+<button onclick='callOleTest( 204)'>unsigned short</Button>
+<button onclick='callOleTest( 205)'>long</Button>
+<button onclick='callOleTest( 206)'>unsigned long</Button>
+<button onclick='callOleTest( 207)'>char</Button>
+<button onclick='callOleTest( 208)'>string</Button>
+<button onclick='callOleTest( 209)'>any</Button>
+<button onclick='callOleTest( 210)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 211)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 212)'>XInterface </Button>
+<p>
+
+<!--
+Test of Any parameter in a method. Any contains:<br>
+<button onclick='callOleTest( 1000)'>integer </Button>
+<button onclick='callOleTest( 1001)'>double </Button>
+<button onclick='callOleTest( 1002)'>string</Button>
+<button onclick='callOleTest( 1003)'>array</Button>
+<button onclick='callOleTest( 1004)'>object</Button>
+<p>
+Test of Any parameter in a property. Any contains:<br>
+<button onclick='callOleTest( 1010)'>integer </Button>
+<button onclick='callOleTest( 1011)'>double </Button>
+<button onclick='callOleTest( 1012)'>string</Button>
+<button onclick='callOleTest( 1013)'>array</Button>
+<button onclick='callOleTest( 1014)'>object</Button>
+<p>
+<p>
+
+
+<h2> Visual Basic Tests </h2>
+Test array /Sequence conversion and return value<br>
+Template: <b> Sequence &lt type &gt method( Sequence&lt type &gt ) </b> <br>
+<!--<font color= red>Multi dimensional arrays are not processed by VBSript</font> <br> -->
+<!--
+<button onclick='callBasic(0)'>byte</button>
+<button onclick='callBasic(1)'>double</button>
+<button onclick='callBasic(2)'>boolean</button>
+<button onclick='callBasic(3)'>short</button>
+<button onclick='callBasic(4)'>u short</button>
+<button onclick='callBasic(5)'>long</button>
+<button onclick='callBasic(6)'>u long</button>
+<button onclick='callBasic(7)'>string</button>
+<button onclick='callBasic(8)'>char</button>
+<button onclick='callBasic(9)'>any</button> <br>
+<button onclick='callBasic(10)'>Seq &lt int &gt</button> <br>
+
+
+Out parameter <br>
+Template: <b> void method( Sequence &lt type &gt ) </b> <br>
+<button onclick='callBasic(100)'>byte</button>
+<button onclick='callBasic(101)'>double</button>
+<button onclick='callBasic(102)'>boolean</button>
+<button onclick='callBasic(103)'>short</button>
+<button onclick='callBasic(104)'>u short</button>
+<button onclick='callBasic(105)'>long</button>
+<button onclick='callBasic(106)'>u long</button>
+<button onclick='callBasic(107)'>string</button>
+<button onclick='callBasic(108)'>char</button>
+<button onclick='callBasic(109)'>any</button> <br>
+
+Tests Array/Sequence conversion with <b>Attributes</b>. All params are of type Sequence and
+ the element type of the Sequence is written on the buttons. <br>
+<button onclick='callBasic( 200)'>byte </Button>
+<button onclick='callBasic( 201)'>double</Button>
+<button onclick='callBasic( 202)'>boolean</Button>
+<button onclick='callBasic( 203)'>short</Button>
+<button onclick='callBasic( 204)'>unsigned short</Button>
+<button onclick='callBasic( 205)'>long</Button>
+<button onclick='callBasic( 206)'>unsigned long</Button>
+<button onclick='callBasic( 207)'>string</Button>
+<button onclick='callBasic( 208)'>char</Button>
+<button onclick='callBasic( 209)'>any</Button>
+<button onclick='callBasic( 210)'>sequence&ltlong&gt </Button>
+
+-->
+
+
diff --git a/extensions/test/ole/OleClient/clientTest.cxx b/extensions/test/ole/OleClient/clientTest.cxx
new file mode 100644
index 000000000000..87de5c766518
--- /dev/null
+++ b/extensions/test/ole/OleClient/clientTest.cxx
@@ -0,0 +1,536 @@
+/*************************************************************************
+ *
+ * $RCSfile: clientTest.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <windows.h>
+#include <comdef.h>
+#include <tchar.h>
+#include <atlbase.h>
+extern CComModule _Module;
+#include<atlcom.h>
+#include<atlimpl.cpp>
+
+#include <com/sun/star/bridge/ModelDependent.hpp>
+#include <com/sun/star/bridge/XBridgeSupplier2.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/script/XInvocation.hpp>
+#include <oletest/XCallback.hpp>
+#include <rtl/process.h>
+#include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/servicefactory.hxx>
+#include <rtl/string.h>
+#pragma hdrstop
+
+
+CComModule _Module;
+BEGIN_OBJECT_MAP(ObjectMap)
+END_OBJECT_MAP()
+
+using namespace com::sun::star::lang;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::script;
+using namespace cppu;
+using namespace rtl;
+HRESULT doTest();
+HRESULT doTest2( Reference<XInvocation> &);
+Reference<XInvocation> getComObject(OUString& );
+
+HRESULT InitializeParameter();
+void printResultVariantArray( VARIANT & var);
+void printVariant( VARIANT & var);
+
+
+Reference< XMultiServiceFactory > objectFactory;
+
+
+int __cdecl _tmain( int argc, _TCHAR * argv[] )
+{
+ HRESULT hr;
+ if( FAILED( hr=CoInitialize(NULL)))
+ {
+ _tprintf(_T("CoInitialize failed \n"));
+ return -1;
+ }
+
+
+ _Module.Init( ObjectMap, GetModuleHandle( NULL));
+
+ if( FAILED(hr=doTest()))
+ {
+ _com_error err( hr);
+ const TCHAR * errMsg= err.ErrorMessage();
+ MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
+ }
+
+
+ _Module.Term();
+ CoUninitialize();
+ return 0;
+}
+
+
+Reference<XInvocation> getComObject( OUString progId)
+{
+ HRESULT hr= S_OK;
+ Reference< XInvocation > ret;
+// Reference<XMultiServiceFactory> fac;
+ if( ! objectFactory.is())
+ {
+ Reference< XMultiServiceFactory > mgr= createRegistryServiceFactory( OUString(L"applicat.rdb"));
+ Reference< XInterface > xInt= mgr->createInstance( OUString(L"com.sun.star.bridge.OleObjectFactory"));
+ objectFactory= Reference<XMultiServiceFactory>::query( xInt);
+ }
+
+ if( objectFactory.is())
+ {
+ Reference<XInterface> xIntAx= objectFactory->createInstance( progId.getStr());
+ if( xIntAx.is() )
+ {
+ Reference< XInvocation > xInv( xIntAx, UNO_QUERY);
+ ret= xInv;
+ }
+ }
+// CComPtr<IUnknown> spUnkMgr;
+// Reference< XInvocation > ret;
+// Reference< XMultiServiceFactory > mgr= createRegistryServiceFactory( OUString(L"applicat.rdb"));
+// Reference< XInterface > xInt= mgr->createInstance(OUString(L"com.sun.star.bridge.OleObjectFactory"));
+// Reference< XMultiServiceFactory > fac( xInt, UNO_QUERY);
+ return ret;
+}
+
+HRESULT doTest()
+{
+ HRESULT hr= S_OK;
+ USES_CONVERSION;
+ Reference<XInvocation> inv= getComObject( L"AxTestComponents.Basic");
+ Sequence< sal_Int16> seqIndices;
+ Sequence<Any> seqOut;
+
+ Any aAny;
+ Any anyOut;
+ char buff[256];
+
+ //###################################################################################
+ // in parameter
+ //###################################################################################
+// aAny <<= ( sal_Int8) 127;
+// inv->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// aAny <<= ( sal_Int16) 0xffff;
+// inv->invoke( OUString(L"inShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+
+// aAny <<= ( sal_Int32) 1234567;
+// inv->invoke( OUString(L"inLong"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// aAny <<= OUString(L" this is clientTest.exe");
+// inv->invoke( OUString(L"inString"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// aAny <<= ( float) 3.14;
+// inv->invoke( OUString(L"inFloat"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// aAny <<= ( double) 3.145;
+// inv->invoke( OUString(L"inDouble"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// aAny <<= OUString( L" A string in an any");
+// inv->invoke( OUString(L"inVariant"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+//
+// OUString arStr[]= {L"string0", L"string1", L"string2"};
+// Sequence<OUString> seq( arStr, 3);
+// Any arAny[1];
+// arAny[0] <<= seq;
+// inv->invoke( OUString(L"inArray"), Sequence< Any > ( arAny, 1), seqIndices, seqOut);
+
+// Reference < XInvocation > inv2= getComObject(L"AxTestComponents.Basic");
+// Any anyVal;
+// anyVal <<= OUString(L"this is the value of prpString");
+// inv2->setValue( OUString(L"prpString"), anyVal);
+// aAny <<= inv2;
+// inv->invoke( OUString(L"inObject"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// //###################################################################################
+// // out parameter
+// //###################################################################################
+ // outByte
+// aAny= Any();
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outByte"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out Byte: %d", *( char*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // outShort
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outShort"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out Short: %d", *( sal_Int16*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // outLong
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outLong"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out Long: %d", *( sal_Int32*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // outString
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outString"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out String: %S", (*( OUString*)anyOut.getValue()).getStr());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // outFloat
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outFloat"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out float: %f", *( float*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // outDouble
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outDouble"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " out double: %g", *( double*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+
+ // outVariant
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outVariant"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// if( anyOut.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// anyOut >>= s;
+// sprintf( buff, " out string ( variant): %S", s.getStr());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+// }
+//
+// // outArray
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outArray"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// Sequence<Any> seqOutValue;
+// anyOut >>= seqOutValue;
+//
+// // we assume that the Sequence contains Anys of strings
+// OUString usMessage;
+// for( int i=0; i < seqOutValue.getLength(); i++)
+// {
+// OUString stemp;
+// if( seqOutValue[i] >>= stemp)
+// {
+// usMessage += OUString(L"\n");
+// usMessage += stemp;
+// }
+// }
+// MessageBox( NULL, W2T( usMessage.getStr()), _T("Test Program"), MB_OK);
+//
+// // outObject
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// inv->invoke( OUString(L"outObject"), Sequence< Any > ( &aAny, 1 ), seqIndices, seqOut);
+// Reference<XInvocation> invOut;
+// if( seqOut[0]>>=invOut)
+// {
+// Any val= invOut->getValue( L"prpString");
+//
+// if( val.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// val>>=s;
+// MessageBox( NULL,W2T( s.getStr()), _T("Test Program"), MB_OK);
+// }
+// }
+
+// //###################################################################################
+// // in/out parameter
+// //###################################################################################
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= ( sal_Int8) 127;
+// inv->invoke( OUString(L"inoutByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " in out Byte: %d", *( char*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+
+ // in out short
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= ( sal_Int16) 1111;
+// inv->invoke( OUString(L"inoutShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " in out Short: %d", *( sal_Int16*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// //in out long
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= ( sal_Int32) 111111;
+// inv->invoke( OUString(L"inoutLong"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, "inout Long: %d", *( sal_Int32*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// //in out string
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= OUString(L" this is clientTest.exe");
+// inv->invoke( OUString(L"inoutString"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " inout String: %S", (*( OUString*)anyOut.getValue()).getStr());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// //in out float
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= ( float) 3.14;
+// inv->invoke( OUString(L"inoutFloat"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " inout float: %f", *( float*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // in out double
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= ( double) 3.145;
+// inv->invoke( OUString(L"inoutDouble"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// sprintf( buff, " inout double: %g", *( double*)anyOut.getValue());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// // in out VARIANT
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// aAny <<= OUString( L" A string in an any");
+// inv->invoke( OUString(L"inoutVariant"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// anyOut <<= seqOut[0];
+// if( anyOut.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// anyOut >>= s;
+// sprintf( buff, " in out string ( variant): %S", s.getStr());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+// }
+
+// // in out Array
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// OUString arStr2[]= {L"string0", L"string1", L"string2"};
+// Sequence<OUString> seq2( arStr2, 3);
+// Any arAny2[1];
+// arAny2[0] <<= seq2;
+// inv->invoke( OUString(L"inoutArray"), Sequence< Any > ( arAny2, 1), seqIndices, seqOut);
+// Sequence<Any> seqOutValue2;
+// seqOut[0]>>= seqOutValue2;
+//
+// // we assume that the Sequence contains Anys of strings
+// OUString usMessage2;
+// for(int i2=0; i2 < seqOutValue2.getLength(); i2++)
+// {
+// OUString stemp;
+// if( seqOutValue2[i2] >>= stemp)
+// {
+// usMessage2 += OUString(L"\n");
+// usMessage2 += stemp;
+// }
+// }
+// MessageBox( NULL, W2T( usMessage2.getStr()), _T("Test Program"), MB_OK);
+
+//
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// Reference < XInvocation > inv3= getComObject(L"AxTestComponents.Basic");
+// Any anyVal2;
+// anyVal2 <<= OUString(L"this is the value of prpString");
+// inv3->setValue( OUString(L"prpString"), anyVal2);
+// aAny <<= inv3;
+// inv->invoke( OUString(L"inoutObject"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut);
+// Reference<XInvocation> invOut2;
+// if( seqOut[0]>>=invOut2)
+// {
+// Any val= invOut2->getValue( L"prpString");
+//
+// if( val.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// val>>=s;
+// MessageBox( NULL,W2T( s.getStr()), _T("Test Program"), MB_OK);
+// }
+// }
+
+ //###################################################################################
+ // mixed parameter
+ //###################################################################################
+// // mixed1
+// seqIndices.realloc( 0);
+// seqOut.realloc(0);
+// Sequence< Any > params(12);
+// sal_Int8 aByte=111;
+// OUString aString(L" a string in a VARIANT");
+// Any param[12];
+// param[0] <<= aByte;
+// param[2] <<= aByte; //in out
+// param[3] <<= aString; // in String
+// param[5] <<= aString; // in out string
+//
+// OUString arStr3[]= {L"string0", L"string1", L"string2"};
+// Sequence<OUString> seq3( arStr3,3);
+// param[6] <<= seq3; // in Array
+// param[8] <<= seq3; // in ou Array
+//
+// Reference < XInvocation > inv4= getComObject(L"AxTestComponents.Basic");
+// Any anyVal3;
+// anyVal3 <<= OUString(L"this is the value of prpString");
+// inv4->setValue( OUString(L"prpString"), anyVal3);
+// param[9] <<= inv4; // in dispatch
+// param[11] <<= inv4;
+// inv->invoke( OUString(L"mixed1"), Sequence< Any > ( param, 12),seqIndices, seqOut);
+//
+// for( int i3=0; i3<seqOut.getLength();i3++)
+// {
+// Any any;
+// any <<= seqOut[i3];
+//
+// }
+// sal_Int8 outChar= *( char*)seqOut[0].getValue();
+// sal_Int8 inoutChar= *( char*)seqOut[1].getValue();
+// sprintf( buff, " out Byte: %d \n in out Byte %d", outChar, inoutChar );
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// OUString outString( *(OUString*)seqOut[2].getValue());
+// OUString inoutString( *(OUString*)seqOut[3].getValue());
+// sprintf( buff, "out string: %S \n in out string: %S", outString.getStr(), inoutString.getStr());
+// MessageBox( NULL, A2T( buff), _T("Test Program"), MB_OK);
+//
+// Sequence< Any > outSeq;
+// seqOut[4] >>= outSeq;
+// OUString usMessage3;
+// for(int i4=0; i4 < outSeq.getLength(); i4++)
+// {
+// OUString stemp;
+// if( outSeq[i4] >>= stemp)
+// {
+// usMessage3 += OUString(L"\n");
+// usMessage3 += stemp;
+// }
+// }
+// MessageBox( NULL, W2T( usMessage3.getStr()), _T("Test Program. out Sequence"), MB_OK);
+//
+// seqOut[5] >>= outSeq;
+// OUString usMessage4;
+// for(int i5=0; i5 < outSeq.getLength(); i5++)
+// {
+// OUString stemp;
+// if( outSeq[i5] >>= stemp)
+// {
+// usMessage4 += OUString(L"\n");
+// usMessage4 += stemp;
+// }
+// }
+// MessageBox( NULL, W2T( usMessage3.getStr()), _T("Test Program. in out Sequence"), MB_OK);
+//
+// Reference<XInvocation> invOut3;
+// seqOut[6] >>= invOut3;
+// if( seqOut[0]>>=invOut3)
+// {
+// Any val= invOut3->getValue( L"prpString");
+//
+// if( val.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// val>>=s;
+// MessageBox( NULL,W2T( s.getStr()), _T("Test Program, out object"), MB_OK);
+// }
+// }
+//
+// Reference<XInvocation> invOut4;
+// seqOut[6] >>= invOut4;
+// if( seqOut[0]>>=invOut4)
+// {
+// Any val= invOut4->getValue( L"prpString");
+//
+// if( val.getValueTypeClass() == TypeClass_STRING)
+// {
+// OUString s;
+// val>>=s;
+// MessageBox( NULL,W2T( s.getStr()), _T("Test Program, in out object"), MB_OK);
+// }
+// }
+
+ //###################################################################################
+ // Sequences
+ //###################################################################################
+
+ seqIndices.realloc( 0);
+ seqOut.realloc(0);
+ sal_Int32 arLong[]={ 1,2,3};
+ Any seqLongAny;
+ seqLongAny<<= Sequence<sal_Int32>( arLong, 3);
+ inv->invoke( OUString(L"inSequenceLong"),Sequence< Any > ( &seqLongAny, 1), seqIndices, seqOut);
+
+ return hr;
+}
diff --git a/extensions/test/ole/OleClient/makefile.mk b/extensions/test/ole/OleClient/makefile.mk
new file mode 100644
index 000000000000..a6b74362ecdb
--- /dev/null
+++ b/extensions/test/ole/OleClient/makefile.mk
@@ -0,0 +1,128 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..$/
+
+PRJNAME=extensions
+TARGET=clientTest
+TARGETTYPE=CUI
+LIBTARGET=NO
+
+#USE_DEFFILE= TRUE
+NO_BSYMBOLIC= TRUE
+ENABLE_EXCEPTIONS=TRUE
+BOOTSTRAP_SERVICE=FALSE
+
+# --- Settings ---
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files ---
+
+UNOUCRDEP= $(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB= $(SOLARBINDIR)$/applicat.rdb
+
+
+UNOUCROUT= $(OUT)$/inc
+INCPRE+= $(OUT)$/inc -I$(SOLARINCDIR)$/external$/atl
+
+
+UNOTYPES= com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.script.XInvocation \
+ oletest.XCallback
+
+
+
+.IF "$(depend)" != ""
+
+.ENDIF # depend
+
+APP1TARGET= $(TARGET)
+APP1OBJS= $(OBJ)$/clientTest.obj
+LIBCMT=msvcrtd.lib
+
+
+APP1STDLIBS= \
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ user32.lib \
+ kernel32.lib \
+ ole32.lib \
+ oleaut32.lib \
+ uuid.lib \
+ comdlg32.lib
+
+
+
+.IF "$(GUI)"=="WNT"
+APP1STDLIBS += $(LIBCIMT)
+.ENDIF
+
+APP1DEF= $(MISC)\$(APP1TARGET).def
+
+# --- Targets ---
+
+.INCLUDE : target.mk
+
diff --git a/extensions/test/ole/OleClient/readme.txt b/extensions/test/ole/OleClient/readme.txt
new file mode 100644
index 000000000000..aff1ce948bc8
--- /dev/null
+++ b/extensions/test/ole/OleClient/readme.txt
@@ -0,0 +1,7 @@
+The program tests the OleClient service which enables to use COM components
+through XInvocation.
+
+Requirements:
+
+applicat.rdb has to be next to the executable.
+COM component: XCallback_Impl.Simple ( extensions/test/ole/unotocomcalls/XCallback_Impl ) \ No newline at end of file
diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx
new file mode 100644
index 000000000000..0ee9ed941005
--- /dev/null
+++ b/extensions/test/ole/OleConverterVar1/convTest.cxx
@@ -0,0 +1,678 @@
+/*************************************************************************
+ *
+ * $RCSfile: convTest.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <windows.h>
+#include <comdef.h>
+#include <tchar.h>
+#include <atlbase.h>
+extern CComModule _Module;
+#include<atlcom.h>
+#include<atlimpl.cpp>
+
+#include <com/sun/star/bridge/ModelDependent.hpp>
+#include <com/sun/star/bridge/XBridgeSupplier2.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <oletest/XTestSequence.hpp>
+#include <rtl/process.h>
+#include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/servicefactory.hxx>
+#include <rtl/string.h>
+#pragma hdrstop
+
+
+CComModule _Module;
+BEGIN_OBJECT_MAP(ObjectMap)
+END_OBJECT_MAP()
+
+#include "smartarray.h"
+using namespace com::sun::star::bridge;
+using namespace com::sun::star::bridge::ModelDependent;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::uno;
+using namespace oletest;
+using namespace cppu;
+using namespace rtl;
+HRESULT doTest();
+HRESULT InitializeParameter();
+void printResultVariantArray( VARIANT & var);
+void printVariant( VARIANT & var);
+
+
+
+
+int __cdecl _tmain( int argc, _TCHAR * argv[] )
+{
+ HRESULT hr;
+ if( FAILED( hr=CoInitialize(NULL)))
+ {
+ _tprintf(_T("CoInitialize failed \n"));
+ return -1;
+ }
+
+
+ _Module.Init( ObjectMap, GetModuleHandle( NULL));
+
+ if( FAILED(hr=doTest()))
+ {
+ _com_error err( hr);
+ const TCHAR * errMsg= err.ErrorMessage();
+ MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
+ }
+
+
+ _Module.Term();
+ CoUninitialize();
+ return 0;
+}
+char _c[]={ 1,2,3,4,5};
+short _short[]={0xffff, 1, 11 ,111, 1111 };
+unsigned short _ushort[]={0xffff, 1, 11 ,111, 1111 };
+long _long[]= { 0xffffffff, 11, 111 ,1111, 1111 };
+unsigned long _ulong[]= { 0xffffffff, 11, 111 ,1111, 1111 };
+float _float[]= { 12345., 1234.5, 123.45, 12.345, 1.2345};
+double _double[]= {12345, 1234.5, 123.45, 12.345, 1.2345};
+
+CComVariant _variant[]= {L"variant 1", L"variant2", L"variant3"};
+wchar_t _wchar[]= {L'1', L'2', L'3', L'A', L' '};
+BSTR _bstr[]={L"Ich", L"bin", L"ein", L"Hamburger", L"Jung"};
+SmartArray<char> arByte( _c, 5, VT_I1);
+SmartArray< short> arShort( _short, 5, VT_I2);
+//SmartArray< unsigned short> arUShort( _ushort, 5, VT_UI2);
+SmartArray< long> arLong( _long, 5, VT_I4);
+//SmartArray< unsigned long> arULong( _ulong, 5, VT_UI4);
+//SmartArray< float> arFloat( _float, 5, VT_R4 );
+SmartArray< double> arDouble( _double, 5, VT_R8 );
+//SmartArray< unsigned short> arWChar( _wchar, 5, VT_UI2 );
+SmartArray< wchar_t* > arString( _bstr, 5, VT_BSTR);
+SmartArray< VARIANT > arVariant( _variant, 3, VT_VARIANT);
+
+
+HRESULT doTest()
+{
+ HRESULT hr;
+ USES_CONVERSION;
+ CComPtr<IUnknown> spUnkMgr;
+
+ Reference< XMultiServiceFactory > mgr= createRegistryServiceFactory( OUString(L"applicat.rdb"));
+ Reference< XInterface > xIntSupplier= mgr->createInstance(OUString(L"com.sun.star.bridge.OleBridgeSupplierVar1"));
+ Reference< XBridgeSupplier2 > xSuppl( xIntSupplier, UNO_QUERY);
+ Reference <XInterface> xOletest= mgr->createInstance( OUString(L"oletest.OleTest"));
+ Any any;
+ any <<= xOletest;
+ sal_uInt8 arId[16];
+ rtl_getGlobalProcessId( arId);
+ Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), UNO, OLE);
+ CComDispatchDriver oletest;
+ if (target.getValueTypeClass() == getCppuType((sal_uInt32*) 0).getTypeClass())
+ {
+ VARIANT* pVariant = *(VARIANT**)target.getValue();
+
+ oletest= pVariant->pdispVal;
+
+ VariantClear(pVariant);
+ CoTaskMemFree(pVariant);
+ }
+
+ CComVariant varRet;
+ CComVariant varParam1;
+ CComVariant varParam2;
+ CComVariant varParam3;
+ CComVariant varParam4;
+
+ long value= 100;
+ varParam1.vt= VT_I1 | VT_BYREF;
+ varParam1.plVal= &value;
+
+ // Testing the caching of DISPIDs and the process of aquiring member information
+ // on demand in IDispatch::Invoke
+ // Step through the corresponding IDispatch implementation of the ole bridge
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet);
+ // Name ok but different case
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet);
+ // not existing member
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet);
+
+ // Property
+ varParam1.vt= VT_ARRAY | VT_I1;
+ varParam1.parray= (SAFEARRAY*)arByte;
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varParam1);
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varParam1);
+ // Name ok but different case
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"attrByte"), &varParam1);
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"attrByte"), &varParam1);
+ // not existing member
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"attr"), &varParam1);
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"attr"), &varParam1);
+
+ // PropertyGet
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varRet);
+
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"attrByte"), &varRet);
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"attrByte"), &varRet);
+ //not existing member
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"attrBy"), &varRet);
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"attrBy"), &varRet);
+
+ DISPID dispid;
+ LPOLESTR method= L"methodByte";
+ hr = oletest.p->GetIDsOfNames(IID_NULL, &method, 1, LOCALE_USER_DEFAULT, &dispid);
+
+
+ CComVariant arg[1];
+ arg[0].vt= VT_ARRAY | VT_I1;
+ arg[0].parray= (SAFEARRAY*)arByte;
+ DISPPARAMS params={ arg,0,1,0};
+
+ hr = oletest.p->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYPUT, &params, &varRet, NULL, NULL);
+
+ hr = oletest.p->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYPUT, &params, &varRet, NULL, NULL);
+
+ // different case
+ LPOLESTR method2= L"MEthodByte";
+ hr = oletest.p->GetIDsOfNames(IID_NULL, &method2, 1, LOCALE_USER_DEFAULT, &dispid);
+
+ hr = oletest.p->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYPUT, &params, &varRet, NULL, NULL);
+
+ hr = oletest.p->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYPUT, &params, &varRet, NULL, NULL);
+
+ LPOLESTR attrib= L"AttrByte";
+ hr = oletest.p->GetIDsOfNames(IID_NULL, &attrib, 1, LOCALE_USER_DEFAULT, &dispid);
+
+ hr = oletest.p->Invoke( dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYPUTREF, &params, &varRet, NULL, NULL);
+
+ hr = oletest.p->Invoke( dispid, IID_NULL, LOCALE_USER_DEFAULT,
+ DISPATCH_METHOD | DISPATCH_PROPERTYGET, &params, &varRet, NULL, NULL);
+
+
+
+ CComVariant varByteArray;
+ varByteArray.vt= VT_ARRAY | VT_I1;
+ varByteArray.parray= (SAFEARRAY*)arByte;
+ CComVariant varShortArray;
+ varShortArray.vt= VT_ARRAY | VT_I2;
+ varShortArray.parray= (SAFEARRAY*)arShort;
+ CComVariant varLongArray;
+ varLongArray.vt= VT_ARRAY | VT_I4;
+ varLongArray.parray= (SAFEARRAY*)arLong;
+ CComVariant varDoubleArray;
+ varDoubleArray.vt= VT_ARRAY | VT_R8;
+ varDoubleArray.parray= (SAFEARRAY*)arDouble;
+ CComVariant varStringArray;
+ varStringArray.vt= VT_ARRAY | VT_BSTR;
+ varStringArray.parray= (SAFEARRAY*)arString;
+ CComVariant varArray;
+ varArray.vt= VT_ARRAY | VT_VARIANT;
+ varArray.parray= (SAFEARRAY*)arVariant;
+
+ FONTDESC fd={ sizeof( fd), L"ARIAL", 10, FW_NORMAL, 0, 0, 0, 0};
+
+
+ CComPtr< IUnknown > unk1;
+ CComPtr< IUnknown > unk2;
+ CComPtr< IUnknown > unk3;
+
+ IUnknown* _unknown[3];
+ hr= OleCreateFontIndirect( &fd, __uuidof( IUnknown), (void**)&unk1.p);
+ hr= OleCreateFontIndirect( &fd, __uuidof( IUnknown), (void**)&unk2.p);
+ hr= OleCreateFontIndirect( &fd, __uuidof( IUnknown), (void**)&unk3.p);
+ _unknown[0]= unk1;
+ _unknown[1]= unk2;
+ _unknown[2]= unk3;
+ SmartArray<IUnknown*> arUnknown( _unknown, 3, VT_UNKNOWN);
+
+ CComVariant varUnkArray;
+ varUnkArray.vt= VT_ARRAY | VT_UNKNOWN;
+ varUnkArray.parray= (SAFEARRAY*)arUnknown;
+
+ // preparing out parameter;
+ char byteOut;
+ CComVariant varOutByte; //###
+ varOutByte.vt= VT_BYREF | VT_UI1;
+ V_I1REF(&varOutByte)= &byteOut;
+ short shortOut;
+ CComVariant varOutShort; //###
+ varOutShort.vt= VT_BYREF | VT_I2;
+ V_I2REF( &varOutShort)= &shortOut;
+ long longOut;
+ CComVariant varOutLong; //###
+ varOutLong.vt= VT_BYREF | VT_I4;
+ V_I4REF( &varOutLong)= &longOut;
+ double doubleOut;
+ CComVariant varOutDouble; //###
+ varOutDouble.vt= VT_BYREF | VT_R8;
+ V_R8REF( &varOutDouble)= &doubleOut;
+ BSTR bstrOut= NULL;
+ CComVariant varOutString; //###
+ varOutString.vt= VT_BYREF | VT_BSTR;
+ V_BSTRREF(&varOutString)= &bstrOut;
+ CComVariant variantOut;
+ CComVariant varOutAny; //###
+ varOutAny.vt= VT_BYREF | VT_VARIANT;
+ V_VARIANTREF(&varOutAny)= &variantOut;
+
+ CComPtr<IDispatch> dispOut;
+ CComVariant varOutXInterface; //###
+ varOutXInterface.vt= VT_BYREF |VT_DISPATCH;
+ V_DISPATCHREF(&varOutXInterface)= &dispOut.p;
+
+ // In Parameter ( all of type Sequence ###########################################################
+ OutputDebugString( _T("In parameter of type Sequence ###########################################\n"
+ "The functions return the Sequence parameter \n\n"));
+
+ OutputDebugStringA("methodByte | Params: \n");
+ printVariant( varByteArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodByte"), &varByteArray, &varRet);
+ OutputDebugStringA("methodByte | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodShort | Params: \n");
+ printVariant( varShortArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodShort"), &varShortArray, &varRet);
+ OutputDebugStringA("methodShort | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodLong | Params: \n");
+ printVariant( varLongArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodLong"), &varLongArray, &varRet);
+ OutputDebugStringA("methodLong | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodDouble | Params: \n");
+ printVariant( varDoubleArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodDouble"), &varDoubleArray, &varRet);
+ OutputDebugStringA("methodDouble | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodString | Params: \n");
+ printVariant( varStringArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodString"), &varStringArray, &varRet);
+ OutputDebugStringA("methodString | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodAny | Params: \n");
+ printVariant( varArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodAny"), &varArray, &varRet);
+ OutputDebugStringA("methodAny | return value \n");
+ printVariant( varRet);
+
+ OutputDebugStringA("methodXInterface | Params: \n");
+ printVariant( varUnkArray);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodXInterface"), &varUnkArray, &varRet);
+ OutputDebugStringA("methodAny | return value \n");
+ printVariant( varRet);
+
+ // Out Parameter ###########################################################################
+ OutputDebugString( _T("Out parameter ###########################################\n\n"));
+
+ OutputDebugString(_T("testout_methodByte \n"));
+ hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testout_methodByte"), &varOutByte, 1, &varRet);
+ OutputDebugString(_T("testout_methodByte | out value: \n"));
+ printVariant( varOutByte);
+
+ OutputDebugString(_T("testout_methodShort \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodShort"), &varOutShort, &varRet);
+ OutputDebugString(_T("testout_methodShort | out value: \n"));
+ printVariant( varOutShort);
+
+ OutputDebugString(_T("testout_methodLong \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodLong"), &varOutLong, &varRet);
+ OutputDebugString(_T("testout_methodLong | out value: \n"));
+ printVariant( varOutLong);
+
+ OutputDebugString(_T("testout_methodDouble \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodDouble"), &varOutDouble, &varRet);
+ OutputDebugString(_T("testout_methodDouble | out value: \n"));
+ printVariant( varOutDouble);
+
+ OutputDebugString(_T("testout_methodString \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodString"), &varOutString, &varRet);
+ OutputDebugString(_T("testout_methodString | out value: \n"));
+ printVariant( varOutString);
+
+ OutputDebugString(_T("testout_methodAny \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodAny"), &varOutAny, &varRet);
+ OutputDebugString(_T("methodAny | out value: \n"));
+ printVariant( varOutAny);
+
+ OutputDebugString(_T("testout_methodXInterface \n"));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodXInterface"), &varOutXInterface, &varRet);
+ OutputDebugString(_T("methodAny | out value: \n"));
+ printVariant( varOutXInterface);
+ CComDispatchDriver outDisp( *varOutXInterface.ppdispVal);
+ CComVariant varAttr3;
+ outDisp.GetPropertyByName(L"AttrAny2", &varAttr3);
+ ATLTRACE("property OleTest.AttrAny2: %s", W2T(varAttr3.bstrVal));
+
+ OutputDebugString(_T("testout_methodMulParams1 ( 2 out Parameter) \n"));
+ long longOut2=0;
+ CComVariant _params[2];
+ longOut=0;
+ _params[0]= varOutLong;
+ _params[1].vt= VT_BYREF | VT_I4;
+ V_I4REF(& _params[1])= &longOut2;
+ hr= oletest.InvokeN( static_cast<LPCOLESTR>(L"testout_methodMulParams1"), (VARIANT*)&_params, 2);
+ OutputDebugString(_T("testout_methodMulParams1 | out values: \n"));
+ printVariant( _params[1]);
+ printVariant( _params[0]);
+
+ OutputDebugString(_T("testout_methodMulParams2 ( 3 out Parameter) \n"));
+ CComVariant _params2[3];
+ _params2[2]= varOutLong;
+ _params2[1].vt= VT_BYREF | VT_I4;
+ V_I4REF(& _params2[1])= &longOut2;
+ _params2[0]= varOutString;
+ hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams2"), (VARIANT*)&_params2, 3);
+ OutputDebugString(_T("testout_methodMulParams2 | out values: \n"));
+ printVariant( _params2[2]);
+ printVariant( _params2[1]);
+ printVariant( _params2[0]);
+
+ OutputDebugString(_T("testout_methodMulParams3 ( 1 in and 1 out Parameter) \n"));
+ CComVariant _params3[2];
+ _params3[1]= CComBSTR(L" In string");
+ _params3[0]= varOutString;
+ hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams3"), (VARIANT*)&_params3, 2);
+ OutputDebugString(_T("testout_methodMulParams3 | out values: \n"));
+ printVariant( _params3[1]);
+ printVariant( _params3[0]);
+
+ //In Out Parameter ###########################################################################
+ OutputDebugString( _T("In Out parameter ###########################################\n\n"));
+
+ *V_I1REF(&varOutByte)= 5;
+ ATLTRACE(_T("testinout_methodByte | in value: %d \n"), *V_I1REF(&varOutByte));
+ hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varOutByte, 1, &varRet);
+ OutputDebugString(_T("testinout_methodByte | out value: \n"));
+ printVariant( varOutByte);
+
+ OutputDebugString(_T("testinout_methodShort | in value= 1000 \n"));
+ *V_UI2REF(&varOutShort)= 1000;
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodShort"), &varOutShort, &varRet);
+ OutputDebugString(_T("testinout_methodShort | out value: \n"));
+ printVariant( varOutShort);
+
+ OutputDebugString(_T("testinout_methodLong | in value= 10000 \n"));
+ *V_UI4REF(&varOutLong)= 10000;
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodLong"), &varOutLong, &varRet);
+ OutputDebugString(_T("testinout_methodLong | out value: \n"));
+ printVariant( varOutLong);
+
+ *V_R8REF(&varOutDouble)= 3.14;
+ ATLTRACE(_T("testinou_methodDouble in value: %f \n"),*V_R8REF(&varOutDouble));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodDouble"), &varOutDouble, &varRet);
+ OutputDebugString(_T("testinout_methodDouble | out value: \n"));
+ printVariant( varOutDouble);
+
+ SysFreeString( *V_BSTRREF(&varOutString));
+ *V_BSTRREF(&varOutString)= SysAllocString( L"this is a in string");
+ ATLTRACE(_T("testinout_methodString | value: %s \n"), W2T(*V_BSTRREF(&varOutString)));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodString"), &varOutString, &varRet);
+ OutputDebugString(_T("testinout_methodString | out value: \n"));
+ printVariant( varOutString);
+
+ CComVariant var1(CComBSTR(L" this is a string in a VARIANT"));
+ CComVariant outVar1;
+ outVar1.vt= VT_BYREF | VT_VARIANT;
+ outVar1.pvarVal= &var1;
+ ATLTRACE(_T("testinout_methodAny | parameter: %s\n"), W2T(var1.bstrVal));
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodAny"), &varOutAny, &varRet);
+ OutputDebugString(_T("testinout_methodAny | out value: \n"));
+ printVariant( varOutAny);
+
+ CComPtr< IUnknown > objectIn = unk1;
+ CComVariant varOutIFace;
+ varOutIFace.vt= VT_BYREF | VT_UNKNOWN;
+ varOutIFace.ppunkVal= &objectIn.p;
+ (*varOutIFace.ppunkVal)->AddRef();
+ OutputDebugString(_T("testinout_methodXInterface | in value: \n"));
+ printVariant(varOutIFace);
+ hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodXInterface"), &varOutIFace, &varRet);
+ OutputDebugString(_T("testinout_methodXInterface | out value: \n"));
+ printVariant( varOutIFace);
+
+ // Properties ######################################################################
+ OutputDebugString( _T(" Properties ###########################################\n\n"));
+
+ OutputDebugString(_T("set property \"AttrByte\" | value"));
+ CComVariant propArByte;
+ propArByte.vt= VT_ARRAY | VT_I1;
+ varParam1.parray= (SAFEARRAY*)arByte;
+ printVariant( varParam1);
+ hr= oletest.PutPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varParam1);
+ OutputDebugString(_T("get property \"AttrByte\" | value:"));
+ varRet.Clear();
+ hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varRet);
+ printVariant( varRet);
+
+
+
+ return S_OK;
+
+
+}
+
+
+void printVariant( VARIANT & _var)
+{
+ HRESULT hr;
+ USES_CONVERSION;
+ CComVariant var;
+ hr= VariantCopyInd( &var, &_var);
+ if( var.vt & VT_ARRAY)
+ {
+ VARTYPE type= var.vt ^ VT_ARRAY;
+ SAFEARRAY * sarray= var.parray;
+ long lbound;
+ long ubound;
+ hr= SafeArrayGetLBound( sarray, 1, &lbound);
+ hr= SafeArrayGetUBound( sarray, 1, &ubound);
+ long count= ubound - lbound + 1;
+ char charValue;
+ BYTE byteValue;
+ short shortValue;
+ long longValue;
+ double doubleValue;
+ IUnknown* unkValue;
+ BSTR bstrValue;
+ OutputDebugString( _T("# Array \n"));
+ for( long i= 0; i < count; i++)
+ {
+// CComVariant variantValue;
+ TCHAR *buf[256];
+ wsprintf( (TCHAR*)buf, _T("%d : "), i);
+ OutputDebugString( (TCHAR*)buf);
+ VARIANT varTemp;
+ VariantInit( &varTemp);
+ VARIANT variantValue;
+ VariantInit( &variantValue);
+ switch( type)
+ {
+ case VT_UI1:
+ hr= SafeArrayGetElement( sarray, &i, &byteValue);
+ varTemp.vt= VT_UI1;
+ V_UI1( &varTemp)= byteValue;
+ printVariant( varTemp);
+ break;
+ case VT_I1:
+ hr= SafeArrayGetElement( sarray, &i, &charValue);
+ varTemp.vt= VT_I1;
+ V_I1( &varTemp)= charValue;
+ printVariant( varTemp);
+ break;
+ case VT_I2:
+ hr= SafeArrayGetElement( sarray, &i, &shortValue);
+ varTemp.vt= VT_I2;
+ V_I2( &varTemp)= shortValue;
+ printVariant( varTemp);
+ break;
+
+ case VT_UI2:
+ case VT_I4:
+ hr= SafeArrayGetElement( sarray, &i, &longValue);
+ varTemp.vt= VT_I4;
+ V_I4( &varTemp)= longValue;
+ printVariant( varTemp);
+ break;
+ case VT_R8:
+ hr= SafeArrayGetElement( sarray, &i, &doubleValue);
+ varTemp.vt= VT_R8;
+ V_R8( &varTemp)= doubleValue;
+ printVariant( varTemp);
+ break;
+ case VT_BSTR:
+ hr= SafeArrayGetElement( sarray, &i, &bstrValue);
+ varTemp.vt= VT_BSTR;
+ varTemp.bstrVal= bstrValue;
+ printVariant( varTemp);
+ break;
+ case VT_VARIANT:
+ hr= SafeArrayGetElement( sarray, &i, &varTemp);
+ printVariant( varTemp);
+ break;
+
+ case VT_UNKNOWN:
+ hr= SafeArrayGetElement( sarray, &i, &unkValue);
+ varTemp.vt= VT_UNKNOWN;
+ varTemp.punkVal= unkValue;
+ printVariant( varTemp);
+ break;
+ }
+
+ VariantClear( &varTemp);
+ VariantClear( &variantValue);
+ }
+
+ }
+ else
+ {
+ TCHAR buf[256];
+ switch (var.vt)
+ {
+ case VT_I1: wsprintf( (TCHAR*)buf, _T(" VT_I1: %d \n"), V_I1( &var) );
+ break;
+ case VT_UI1: wsprintf( (TCHAR*)buf, _T(" VT_UI1: %d \n"), V_I1( &var) );
+ break;
+
+ case VT_I2: wsprintf( (TCHAR*)buf, _T(" VT_I2: %d \n"), V_I2( &var) );
+ break;
+ case VT_I4: wsprintf( (TCHAR*)buf, _T(" VT_I4: %d \n"), V_I4( &var) );
+ break;
+ case VT_R8:
+ {
+
+// int decimal, sign;
+// char *buffer;
+// int precision = 14;
+// double source = 3.1415926535;
+
+// buffer = _ecvt( V_R8(&var), precision, &decimal, &sign );
+ sprintf( (TCHAR*)buf, _T(" VT_R8: %f \n"),V_R8( &var) );
+ break;
+ }
+ case VT_UNKNOWN:
+ // The object implement IFont
+ {
+ CComDispatchDriver disp( var.punkVal);
+ CComVariant ret;
+ hr= disp.GetPropertyByName( static_cast<LPCOLESTR>(L"Name"), &ret);
+ wsprintf( (TCHAR*)buf, _T(" VT_UNKNOWN: property \"Name\": %s \n"), W2T(ret.bstrVal));
+ break;
+ }
+ case VT_DISPATCH:
+ // The object implement IFont
+ {
+ CComDispatchDriver disp( var.punkVal);
+ CComVariant ret;
+ if( SUCCEEDED( hr= disp.GetPropertyByName( static_cast<LPCOLESTR>(L"Name"), &ret)))
+ wsprintf( (TCHAR*)buf, _T(" VT_DISPATCH: property \"Name\": %s \n"), W2T(ret.bstrVal));
+ else
+ wsprintf( (TCHAR*)buf, _T(" VT_DISPATCH \n"));
+
+ break;
+ }
+
+
+ case VT_BSTR:
+ {
+ TCHAR* str= W2T( var.bstrVal);
+ wsprintf( (TCHAR*)buf, _T(" VT_BSTR: %s \n"), str);
+ }
+ break;
+ default:
+ wsprintf( (TCHAR*)buf, _T("\n"));
+
+ }
+
+ OutputDebugString( (TCHAR*) buf);
+ }
+
+ return;
+
+}
+
diff --git a/extensions/test/ole/OleConverterVar1/makefile.mk b/extensions/test/ole/OleConverterVar1/makefile.mk
new file mode 100644
index 000000000000..e7d8fbd9c992
--- /dev/null
+++ b/extensions/test/ole/OleConverterVar1/makefile.mk
@@ -0,0 +1,136 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..$/
+
+PRJNAME=extensions
+TARGET=convTest
+TARGETTYPE=CUI
+LIBTARGET=NO
+
+#USE_DEFFILE= TRUE
+NO_BSYMBOLIC= TRUE
+ENABLE_EXCEPTIONS=TRUE
+BOOTSTRAP_SERVICE=FALSE
+
+# --- Settings ---
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files ---
+
+UNOUCRDEP= $(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB= $(SOLARBINDIR)$/applicat.rdb
+
+.IF "$(BOOTSTRAP_SERVICE)" == "TRUE"
+UNOUCROUT= $(OUT)$/inc$/comprehensive
+INCPRE+= $(OUT)$/inc$/comprehensive
+CPPUMAKERFLAGS += -C
+.ELSE
+UNOUCROUT= $(OUT)$/inc
+INCPRE+= $(OUT)$/inc -I$(SOLARINCDIR)$/3rdparty$/atl
+.ENDIF
+
+UNOTYPES= com.sun.star.bridge.ModelDependent \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.bridge.XBridgeSupplier2
+
+
+
+.IF "$(depend)" != ""
+
+.ENDIF # depend
+
+APP1TARGET= $(TARGET)
+APP1OBJS= $(OBJ)$/convTest.obj
+LIBCMT=msvcrtd.lib
+
+
+APP1STDLIBS= \
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ user32.lib \
+ kernel32.lib \
+ ole32.lib \
+ oleaut32.lib \
+ uuid.lib \
+ comdlg32.lib
+
+
+
+#gdi32.lib winspool.lib advapi32.lib shell32.lib odbc32.lib odbccp32.lib
+
+
+.IF "$(GUI)"=="WNT"
+APP1STDLIBS += $(LIBCIMT)
+APP2STDLIBS += $(LIBCIMT)
+.ENDIF
+
+APP1DEF= $(MISC)\$(APP1TARGET).def
+
+# --- Targets ---
+
+.INCLUDE : target.mk
+
diff --git a/extensions/test/ole/OleConverterVar1/readme.txt b/extensions/test/ole/OleConverterVar1/readme.txt
new file mode 100644
index 000000000000..104fb1808583
--- /dev/null
+++ b/extensions/test/ole/OleConverterVar1/readme.txt
@@ -0,0 +1,2 @@
+The program test the Service com.sun.star.bridge.OleBridgeSupplierVar1.
+While running in debug mode it writes infos to the debug - output. \ No newline at end of file
diff --git a/extensions/test/ole/OleConverterVar1/smartarray.h b/extensions/test/ole/OleConverterVar1/smartarray.h
new file mode 100644
index 000000000000..7d1f45710b06
--- /dev/null
+++ b/extensions/test/ole/OleConverterVar1/smartarray.h
@@ -0,0 +1,267 @@
+/*************************************************************************
+ *
+ * $RCSfile: smartarray.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SMARTARRAY_H
+#define _SMARTARRAY_H
+
+
+template< class sourceType>
+class SmartArray
+{
+ SAFEARRAY *m_array;
+public:
+
+ SmartArray( sourceType * parParams, int count, VARTYPE destVartype): m_array(NULL)
+ {
+ HRESULT hr= S_OK;
+ SAFEARRAYBOUND rgsabound[1];
+ rgsabound[0].cElements= count;
+ rgsabound[0].lLbound= 0;
+ m_array= SafeArrayCreate( destVartype, 1, rgsabound);
+ SafeArrayLock( m_array);
+
+ void* pData;
+ if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) )
+ {
+
+ for( int i=0; i< count; i++)
+ {
+ CComVariant varSource( parParams[i]);
+ switch (destVartype)
+ {
+ case VT_I1:
+ {
+ char* p= (char*) pData;
+ if( SUCCEEDED( hr= varSource.ChangeType( destVartype)))
+ p[i]= V_I1( &varSource);
+ break;
+ }
+ case VT_I2:
+ {
+ short* p= (short*) pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_I2( &varSource);
+ break;
+ }
+ case VT_UI2:
+ {
+ unsigned short* p= (unsigned short*) pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_UI2( &varSource);
+ break;
+ }
+ case VT_I4:
+ {
+ long* p= (long*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_I4( &varSource);
+ break;
+ }
+ case VT_UI4:
+ {
+ unsigned long* p= (unsigned long*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_UI4( &varSource);
+ break;
+ }
+ case VT_R4:
+ {
+ float* p= (float*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_R4( &varSource);
+ break;
+ }
+ case VT_R8:
+ {
+ double* p= (double*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_R8( &varSource);
+ break;
+ }
+ case VT_BOOL:
+ {
+ VARIANT_BOOL* p= (VARIANT_BOOL*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ p[i]= V_BOOL( &varSource);
+ break;
+ }
+ case VT_BSTR:
+ {
+ BSTR* pBstr= ( BSTR*)pData;
+ if( SUCCEEDED( hr=varSource.ChangeType( destVartype)))
+ pBstr[i]= SysAllocString(V_BSTR( &varSource));
+ break;
+ }
+ case VT_VARIANT:
+ {
+ VARIANT *pVariant= (VARIANT*)pData;
+ hr= VariantCopy( &pVariant[i], &varSource); break;
+ }
+// case VT_UNKNOWN:
+// {
+// long* pUnk= (long*)pData;
+// pUnk[i]= reinterpret_cast<long>(parParams[i]);
+// ((IUnknown*)pUnk[i])->AddRef(); break;
+// }
+// case VT_DISPATCH:
+// {
+// long* pDisp= (long*)pData;
+// pDisp[i]= (long)parParams[i];
+// ((IDispatch*)pDisp[i])->AddRef(); break;
+// }
+ default:
+ hr= E_FAIL;
+ }
+ }
+ if( FAILED( hr))
+ {
+ SafeArrayDestroy( m_array);
+ m_array= NULL;
+ }
+ }
+ SafeArrayUnaccessData( m_array);
+ }
+ ~SmartArray(){
+ SafeArrayUnlock( m_array);
+ SafeArrayDestroy( m_array );
+ }
+
+ operator bool (){ return m_array == NULL ? false : true; }
+
+ operator SAFEARRAY* (){ return m_array;}
+
+};
+
+template<>
+class SmartArray<IUnknown*>
+{
+ SAFEARRAY *m_array;
+public:
+
+ SmartArray( sourceType * parParams, int count, VARTYPE destVartype);
+// {
+// ATLTRACE("SmartArray<IUnknown>");
+// HRESULT hr= S_OK;
+// SAFEARRAYBOUND rgsabound[1];
+// rgsabound[0].cElements= count;
+// rgsabound[0].lLbound= 0;
+// m_array= SafeArrayCreateVector( VT_UNKNOWN, 0, count);
+// SafeArrayLock( m_array);
+//
+// IUnknown* *pData;
+// if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) )
+// {
+//
+// for( int i=0; i< count; i++)
+// {
+// CComVariant varSource( parParams[i]);
+// switch (destVartype)
+// {
+//
+// case VT_UNKNOWN:
+// {
+// pData[i]= parParams[i];
+// pData[i]->AddRef();
+// }
+// default:
+// hr= E_FAIL;
+// }
+// }
+// if( FAILED( hr))
+// {
+// SafeArrayDestroy( m_array);
+// m_array= NULL;
+// }
+// }
+// SafeArrayUnaccessData( m_array);
+// }
+ ~SmartArray(){
+ SafeArrayUnlock( m_array);
+ SafeArrayDestroy( m_array );
+ }
+
+ operator bool (){ return m_array == NULL ? false : true; }
+
+ operator SAFEARRAY* (){ return m_array;}
+
+};
+
+template <> SmartArray <IUnknown*>::SmartArray(sourceType * parParams, int count, VARTYPE destVartype):m_array(NULL)
+{
+ ATLTRACE("SmartArray<IUnknown>");
+ HRESULT hr= S_OK;
+ SAFEARRAYBOUND rgsabound[1];
+ rgsabound[0].cElements= count;
+ rgsabound[0].lLbound= 0;
+ m_array= SafeArrayCreateVector( VT_UNKNOWN, 0, count);
+ SafeArrayLock( m_array);
+
+ IUnknown* *pData;
+ if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) )
+ {
+ for( int i=0; i< count; i++)
+ {
+ pData[i]= parParams[i];
+ pData[i]->AddRef();
+ }
+ }
+ SafeArrayUnaccessData( m_array);
+};
+#endif
diff --git a/extensions/test/ole/OleTest.htm b/extensions/test/ole/OleTest.htm
new file mode 100644
index 000000000000..d59392eb9ce9
--- /dev/null
+++ b/extensions/test/ole/OleTest.htm
@@ -0,0 +1,943 @@
+<HTML>
+<HEAD>
+<META NAME="GENERATOR" Content="Microsoft Developer Studio">
+<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
+<TITLE>Document Title</TITLE>
+</HEAD>
+<BODY id=theBody>
+
+<script language="JScript">
+function callOleTest( id)
+{
+ var factory= new ActiveXObject("com.sun.star.ServiceManager");
+ var oletest= factory.createInstance("oletest.OleTest");
+// alert(oletest);
+
+ var arr= new Array( 1, 2, 3, 4, 0);
+ var arrDouble= new Array( 1.2345, 12.345, 123,45, 1234.5, 12345);
+ var arrBool= new Array( 1, 0, 2, 0, 3);
+ var arrChar= new Array( '1', 'A', "1", "A", ' ', 55, 56);
+ var arrString= new Array("hamburger","cheeseburger", "chicken nuggets", "chicken wings" , "pizza");
+ var arrAny= new Array( 100, 100.1235,"hallo");
+ var arrSeq= new Array( arr, arr, arr);
+ var arrSeq2= new Array( arrSeq, arrSeq, arrSeq)
+
+
+ var arrout1= new Array();
+ var arrout2= new Array();
+ var arrout3= new Array();
+
+ var ret, i;
+ var sfarray, sfarray1, sfarray2, sfarray3;
+ switch( id)
+ {
+ // Array in-params
+ case 1: ret= oletest.methodByte( arr);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() + "<br>");
+ document.writeln( "Returns a Sequence&lt BYTE &gt <br>" + sfarray.toArray()) ; break;
+
+ case 2: ret= oletest.methodDouble( arrDouble);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrDouble.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt double &gt <br>" + sfarray.toArray()) ; break;
+
+ case 3: ret= oletest.methodBool( arrBool);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrBool.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt BOOL &gt <br>" + sfarray.toArray()) ; break;
+
+ case 4: ret= oletest.methodShort( arr);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt SHORT &gt <br>" + sfarray.toArray()) ; break;
+
+ case 5: ret= oletest.methodUShort( arr);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt unsigned SHORT &gt <br>" + sfarray.toArray()) ; break;
+
+ case 6: ret= oletest.methodLong( arr);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt LONG &gt <br>" + sfarray.toArray()) ; break;
+
+ case 7: ret= oletest.methodULong( arr);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arr.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt unsigned LONG &gt <br>" + sfarray.toArray()) ; break;
+
+ case 8: ret= oletest.methodChar( arrChar);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrChar.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt wchar_t &gt <br>" + sfarray.toArray()) ; break;
+
+ case 9: ret= oletest.methodString( arrString);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrString.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt UString &gt <br>" + sfarray.toArray()) ; break;
+
+ case 10: ret= oletest.methodAny( arrAny);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrAny.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt UsrAny &gt <br>" + sfarray.toArray() ) ; break;
+
+ case 11: ret= oletest.methodSequence( arrSeq);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrSeq.toString() +"<br>");
+ document.writeln("Returns a Sequence&lt Sequence &lt long &gt&gt <br>") ;
+ var arr1= new Array();
+ arr1= sfarray.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ var arr2= new Array();
+ arr2= sfarray2.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+
+ case 12: ret= oletest.methodSequence2( arrSeq2);
+ document.writeln( "Param: " + arrSeq2.toString() +"<br>");
+ sfarray1= new VBArray( ret);
+ arr1= sfarray1.toArray();
+ for( i=0; i < arr1.length; i++)
+ {
+ sfarray2= new VBArray( arr1[i]);
+ arr2= sfarray2.toArray();
+
+ for ( j=0; j < arr2.length; j++)
+ {
+ sfarray3= new VBArray( arr2[j]);
+ arr3= sfarray3.toArray();
+ document.write( i+ " ");
+ document.writeln(j + ": "+ arr3.toString() + "<br>" );
+ }
+
+ }
+ break;
+
+ case 13:
+ var ar= new Array();
+ for( i=0; i< 3; i++)
+ {
+ var ob= new Object();
+ ob.value= "A JScript object!";
+ ar[i]= ob;
+ }
+
+ ret = oletest.methodXInterface( ar);
+ sfarray= new VBArray( ret);
+ var arRet= sfarray.toArray();
+
+ document.writeln( "Params : Array containing objects ")
+ for( index in ar)
+ {
+ document.writeln( "object " + index + ": " + ar[index].value +" ");
+ }
+ document.writeln( "<br>" ) ;
+ document.writeln("Return: <br>");
+ for( index in arRet)
+ {
+ document.writeln( "object " + index + ": " + arRet[index].value + " ");
+ }
+ break;
+
+ case 14: ret= oletest.methodFloat( arrDouble);
+ sfarray= new VBArray( ret);
+ document.writeln( "Param: " + arrDouble.toString() +"<br>");
+ document.writeln( "Returns a Sequence&lt float&gt <br>" + sfarray.toArray()) ; break;
+
+
+
+
+
+
+ // Properties: setting and getting values
+ case 200: oletest.AttrByte = arr;
+ ret= oletest.AttrByte;
+ document.writeln("Setting AttrByte: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrByte: " + arr.toString()); break;
+
+ case 201: oletest.AttrDouble= arrDouble;
+ ret= oletest.AttrDouble;
+ document.writeln("Setting AttrDouble: " + arrDouble.toString() + "<p>");
+ document.writeln("Getting AttrDouble: " + arrDouble.toString()); break;
+
+ case 202: oletest.AttrBool= arrBool;
+ ret= oletest.AttrBool;
+ document.writeln("Setting AttrBool: " + arrBool.toString() + "<p>");
+ document.writeln("Getting AttrBool: " + arrBool.toString()); break;
+
+ case 203: oletest.AttrShort= arr;
+ ret= oletest.AttrShort;
+ document.writeln("Setting AttrShort: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrShort: " + arr.toString()); break;
+
+ case 204: oletest.AttrUShort= arr;
+ ret= oletest.AttrUShort;
+ document.writeln("Setting AttrUShort: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrUShort: " + arr.toString()); break;
+
+ case 205: oletest.AttrLong= arr;
+ ret= oletest.AttrLong;
+ document.writeln("Setting AttrLong: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrLong: " + arr.toString()); break;
+
+ case 206: oletest.AttrULong= arr;
+ ret= oletest.AttrULong;
+ document.writeln("Setting AttrULong: " + arr.toString() + "<p>");
+ document.writeln("Getting AttrULong: " + arr.toString()); break;
+
+ case 207: oletest.AttrChar= arrChar;
+ ret= oletest.AttrChar;
+ document.writeln("Setting AttrChar: " + arrChar.toString() + "<p>");
+ document.writeln("Getting AttrChar: " + arrChar.toString()); break;
+
+ case 208: oletest.AttrString= arrString;
+ ret= oletest.AttrString;
+ document.writeln("Setting AttrString: " + arrString.toString() + "<p>");
+ document.writeln("Getting AttrString: " + arrString.toString()); break;
+
+ case 209: oletest.AttrAny= arrAny;
+ ret= oletest.AttrAny;
+ document.writeln("Setting AttrAny: " + arrAny.toString() + "<p>");
+ document.writeln("Getting AttrAny: " + arrAny.toString()); break;
+
+ case 210: oletest.AttrSequence= arrSeq;
+ ret= oletest.AttrSequence;
+ document.writeln("Setting AttrSequence: " + arrSeq.toString() + "<p>");
+ document.writeln("Getting AttrSequence: " + arrSeq.toString()); break;
+
+ case 211: oletest.AttrSequence2= arrSeq2;
+ ret= oletest.AttrSequence2;
+ document.writeln("Setting AttrSequence2: " + arrSeq2.toString() + "<p>");
+ document.writeln("Getting AttrSequence2: " + arrSeq2.toString()); break;
+
+ case 212: oletest.AttrFloat= arrDouble;
+ ret= oletest.AttrFloat;
+ document.writeln("Setting AttrFloat: " + arrDouble.toString() + "<p>");
+ document.writeln("Getting AttrFloat: " + arrDouble.toString()); break;
+
+
+
+ // Out-parameter ------------------------------------------------------------
+ case (2000):
+ oletest.testout_methodByte( arrout1 );
+ alert("byte: " + arrout1[0] ); break;
+ case (2001):
+ oletest.testout_methodDouble( arrout1 );
+ alert( "double: " + arrout1[0] ); break;
+ case (2002):
+ oletest.testout_methodBool( arrout1 );
+ alert( "boolean: " + arrout1[0] ); break;
+ case (2003):
+ oletest.testout_methodShort( arrout1 );
+ alert( "short: " + arrout1[0] ); break;
+ case (2004):
+ oletest.testout_methodUShort( arrout1 );
+ alert( "unsigned short: " + arrout1[0] ); break;
+ case (2005):
+ oletest.testout_methodLong( arrout1 );
+ alert( "long: " + arrout1[0] ); break;
+ case (2006):
+ oletest.testout_methodULong( arrout1 );
+ alert( "unsigned long: " + arrout1[0] ); break;
+ case (2007):
+ oletest.testout_methodChar( arrout1 );
+ alert( "char: " + arrout1[0] ); break;
+ case (2008):
+ oletest.testout_methodString( arrout1 );
+ alert( "string: " + arrout1[0] ); break;
+ case (2009):
+ oletest.testout_methodAny( arrout1 );
+ alert( "any: " + arrout1[0] ); break;
+ case (2010):
+ oletest.testout_methodSequence( arrout1 );
+ var sfarray= new VBArray( arrout1[0]);
+ arr= sfarray.toArray();
+ document.writeln("use the browser's back arrow to go to the previous page <p>");
+ document.writeln( arr.toString());
+ break;
+ case (2011):
+ oletest.testout_methodSequence2( arrout1 );
+ var sfarray= new VBArray( arrout1[0]);
+ arr= sfarray.toArray();
+ var i;
+ for( i=0; i < arr.length; i++)
+ {
+ var sfarray= new VBArray( arr[i]);
+ var arr2= new Array();
+ arr2= sfarray.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+ case (2012):
+ oletest.testout_methodMulParams1( arrout1, arrout2 );
+ document.writeln( "int : " + arrout1[0] + " int :" + arrout2[0] ); break;
+ case (2013):
+ oletest.testout_methodMulParams2( arrout1, arrout2, arrout3 );
+ document.writeln( "int: " + arrout1[0] + " int: " + arrout2[0] + " string: " + arrout3[0] ); break;
+ case (2014):
+ oletest.testout_methodMulParams3( "hallo", arrout1 );
+ document.writeln( "string: " + arrout1[0] ); break;
+ case (2015):
+ oletest.testout_methodXInterface( arrout1 );
+ document.writeln( "string: " + arrout1[0].AttrAny2); break;
+ case (2016):
+ oletest.testout_methodFloat( arrout1 );
+ alert( "float: " + arrout1[0] ); break;
+ case (2017):
+ var in1= 3.14;
+ var in2= 1111;
+ var in3= -2222;
+ oletest.testout_methodMulParams4( in1, arrout1, in2, arrout2, in3 );
+ document.write("param1 [in] float: " + in1 + " param2 [out] float: " + arrout1[0] +
+ " param3 [in] long: " + in2 + " param4 [out] long: " + arrout2[0] +
+ " param5 [in] long: " + in3);
+ break;
+
+
+ // INOUT - Parameter -------------------------------------------------------------------------------
+ // The in value has to be placed on index 0 of the passed in array
+ case (500):
+ arrout1[0]= 100;
+ oletest.testinout_methodByte( arrout1 );
+ alert("byte: " + arrout1[0] ); break;
+ case (501):
+ arrout1[0]= 3.14;
+ oletest.testinout_methodDouble( arrout1 );
+ alert( "double: " + arrout1[0] ); break;
+ case (502):
+ arrout1[0]= false;
+ oletest.testinout_methodBool( arrout1 );
+ alert( "boolean: " + arrout1[0] ); break;
+ case (503):
+ arrout1[0]= 200;
+ oletest.testinout_methodShort( arrout1 );
+ alert( "short: " + arrout1[0] ); break;
+ case (504):
+ arrout1[0]= 300;
+ oletest.testinout_methodUShort( arrout1 );
+ alert( "unsigned short: " + arrout1[0] ); break;
+ case (505):
+ arrout1[0]= 400;
+ oletest.testinout_methodLong( arrout1 );
+ alert( "long: " + arrout1[0] ); break;
+ case (506):
+ arrout1[0]= 500;
+ oletest.testinout_methodULong( arrout1 );
+ alert( "unsigned long: " + arrout1[0] ); break;
+ case (507):
+ arrout1[0]= "A";
+ oletest.testinout_methodChar( arrout1 );
+ alert( "char: " + arrout1[0] ); break;
+ case (508):
+ arrout1[0]= "I am a string";
+ oletest.testinout_methodString( arrout1 );
+ alert( "string: " + arrout1[0] ); break;
+ case (509):
+ arrout1[0]= arr;
+ oletest.testinout_methodAny( arrout1 ); // the method simply returns the argument
+ sfarray= new VBArray( arrout1[0]);
+ arr= sfarray.toArray();
+ alert( "any: " + arr.toString() ); break;
+ case (510):
+ arrout1[0]= arr;
+ oletest.testinout_methodSequence( arrout1 );
+ var sfarray= new VBArray( arrout1[0]);
+ arr= sfarray.toArray();
+ document.writeln("use the browser's back arrow to go to the previous page <p>");
+ document.writeln( arr.toString());
+ break;
+ case (511):
+ arrout1[0]= arrSeq;
+ oletest.testinout_methodSequence2( arrout1 );
+ var sfarray= new VBArray( arrout1[0]);
+ arr= sfarray.toArray();
+ var i;
+ for( i=0; i < arr.length; i++)
+ {
+ var sfarray= new VBArray( arr[i]);
+ var arr2= new Array();
+ arr2= sfarray.toArray();
+ document.writeln( arr2.toString() + "<br>" );
+ }
+ break;
+ case 512:
+ var ob= new Object();
+ ob.value= "this is a string";
+
+ arrout1[0]= ob;
+ alert (arrout1[0].value);
+ oletest.testinout_methodXInterface( arrout1);
+ var outValue= arrout1[0];
+ for ( key in outValue)
+ {
+ document.write( outValue[key] );
+ }
+ document.write("Out value: " + outValue );
+ document.write("Out 1 value: " + arrout1[1]);
+ break;
+
+// var ob= new Object();
+// ob.value= "this is a string";
+// inoutValue.Set( "object", ob);
+// oletest.testinout_methodXInterface( inoutValue);
+// document.write("Out value: " + inoutValue.Get().value );
+// break;
+
+ case (513):
+ arrout1[0]= 3.14;
+ oletest.testinout_methodFloat( arrout1 );
+ alert( "float: " + arrout1[0] ); break;
+
+
+
+ // Test ANY
+ // Methods
+ case 1000:
+ i= 100;
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1001:
+ i= 3.14;
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1002:
+ i= "Hallo"
+ ret= oletest.methodAnyTest1( i);
+ document.writeln( "in: " + i + " ret: " + ret);
+ break;
+ case 1003:
+ i= arr;
+ ret= oletest.methodAnyTest1( i);
+ sfarray= new VBArray( ret);
+ document.writeln( "in: " + i + " ret: " + sfarray.toArray());
+ break;
+ case 1004:
+ var obj= new Object();
+ obj[1]= "This is index 0";
+ ret= oletest.methodAnyTest1( obj);
+ document.writeln( "in: " + obj + " ret: " + ret);
+ break;
+
+
+ // Test ANY property
+ case 1010:
+ i= 100;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1011:
+ i= 3.14;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1012:
+ i= "Hallo"
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + i + " get: " + ret);
+ break;
+ case 1013:
+ i= arr;
+ oletest.AttrAny2= i;
+ ret= oletest.AttrAny2;
+ sfarray= new VBArray( ret);
+ document.writeln( "set: " + i + " get: " + sfarray.toArray());
+ break;
+ case 1014:
+ var obj= new Object();
+ obj[1]= "This is index 0";
+ oletest.AttrAny2= obj;
+ ret= oletest.AttrAny2;
+ document.writeln( "set: " + obj + " get: " + ret);
+ break;
+
+ case 1020:
+ var val= 3.14;
+ oletest.in_float( val);
+ break;
+
+ case 2100:
+ alert("2100");
+ var ret= oletest.retMethodByte();
+ var sfarray= VBArray( ret);
+ document.writeln( sfarray.toArray() );
+ break;
+
+
+
+ }
+
+}
+
+function funcOut( out)
+{
+ out["du"]= 0xffff;
+}
+
+</script>
+
+<script language="VBScript">
+
+sub callBasic(id)
+
+ Dim factory
+ Set factory= GetObject("", "com.sun.star.ServiceManager")
+
+ Set oletest= factory.createInstance("oletest.OleTest")
+
+
+ arrInt= Array(1,2,3,4,5)
+ arrInt2= Array( -1, -2, 127, 128, 0)
+ arrDouble= Array(1.1, 2.2, 3.3, 4.4, 5.5)
+ arrBool= Array(0,1,0,2,0)
+ arrLong= Array( &Hff, &Hffff, &Hffffff, &Hffffffff)
+ arrString= Array("Chicken Wings", "Cheeseburger", "Hamburger")
+ arrChar= Array("a",65, "M")
+ arrAny= Array("Mickey", 3.14, 100, "A")
+
+ Dim arrDim2Int(1,1)
+ For i= 0 To 1
+ For j= 0 To 1
+ arrDim2Int(i,j) = i*2 + j
+ Next
+ Next
+
+ Dim arrDim3Int(1,1,1)
+ For i= 0 To 1
+ For j= 0 To 1
+ For k=0 To 1
+ arrDim3Int(i,j,k) = i*2 + j*2 + k
+ Next
+ Next
+ Next
+
+
+ select case id
+ case 0
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodByte(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 1
+ document.writeln "param: "
+ printArray arrDouble
+ ret= oletest.methodDouble(arrDouble)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 2
+ document.writeln "param: "
+ printArray arrBool
+ ret= oletest.methodBool(arrBool)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 3
+ document.writeln "param: "
+ printArray arrInt2
+ ret= oletest.methodShort(arrInt2)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 4
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodUShort(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 5
+ document.writeln "param: "
+ printArray arrLong
+ ret= oletest.methodLong(arrLong)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 6
+ document.writeln "param: "
+ printArray arrInt
+ ret= oletest.methodULong(arrInt)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 7
+ document.writeln "param: "
+ printArray arrString
+ ret= oletest.methodString(arrString)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 8
+ document.writeln "param: "
+ printArray arrChar
+ ret= oletest.methodChar(arrChar)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 9
+ document.writeln "param: "
+ printArray arrAny
+ ret= oletest.methodAny(arrAny)
+ document.writeln "<br> return value: "
+ printArray ret
+ case 10
+ document.writeln "param: "
+ printArray2 arrDim2Int
+ ret= oletest.methodSequence(arrDim2Int)
+ document.writeln "<br> return value: "
+ for each val in ret
+ document.write "<br> array: "
+ for each val2 in val
+ document.write val2
+ next
+ next
+
+ // Out Parameter
+ case 150
+ dim rOut
+ oletest.testout_methodByte rOut
+ MsgBox rOut
+// void testout_methodFloat( [out] float rOut);
+// void testout_methodDouble( [out] double rOut);
+// void testout_methodBool( [out] boolean rOut);
+// void testout_methodShort( [out] short rOut);
+// void testout_methodUShort( [out] unsigned short rOut);
+// void testout_methodLong( [out] long rOut);
+// void testout_methodULong( [out] unsigned long rOut);
+
+
+ // In Out Parameter --------------------------------------------------
+ case 100
+ a= 100
+ document.write "param: " & CStr( a) & "<br>"
+ oletest.testinout_methodByte a
+ document.write a
+ case 101
+ a= 1.11
+ document.write "param: " & CStr( a) & "<br>"
+ oletest.testinout_methodDouble a
+ document.write a
+ case 102
+ a= 5
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodBool a
+ document.write a
+ case 103
+ a= -10
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodShort a
+ document.write a
+ case 104
+ a= 128
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodUShort a
+ document.write a
+ case 105
+ a= 65556
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodLong a
+ document.write a
+ case 106
+ a= 65556
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodULong a
+ document.write a
+ case 107
+ a= "ein test string"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodString a
+ document.write a
+ case 108
+ a= "W"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testinout_methodChar a
+ document.write a
+ case 109
+ a= "Ein String im Any"
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.other_methodAnyIn a
+ document.write a
+
+ case 150
+ dim a
+ document.write "param: "& CStr( a) & "<br>"
+ oletest.testout_methodByte( a)
+ document.write a
+// Attributes -----------------------------------------------------------------
+ case 200
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrByte= arrInt
+ b= oletest.AttrByte
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 201
+ document.write "set: "
+ printArray arrDouble
+ oletest.AttrDouble= arrDouble
+ b= oletest.AttrDouble
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 202
+ document.write "set: "
+ printArray arrBool :
+ oletest.AttrBool= arrBool
+ b= oletest.AttrBool
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 203
+ document.write "set: "
+ printArray arrInt2 :
+ oletest.AttrShort= arrInt2
+ b= oletest.AttrShort
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 204
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrUShort= arrInt
+ b= oletest.AttrUShort
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 205
+ document.write "set: "
+ printArray arrInt2
+ oletest.AttrLong= arrInt2
+ b= oletest.AttrLong
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 206
+ document.write "set: "
+ printArray arrInt
+ oletest.AttrULong= arrInt
+ b= oletest.AttrULong
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 207
+ document.write "set: "
+ printArray arrString
+ oletest.AttrString= arrString
+ b= oletest.AttrString
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 208
+ document.write "set: "
+ printArray arrChar
+ oletest.AttrChar= arrChar
+ b= oletest.AttrChar
+ call printArrayEx( "<br> get: ", "<br>", b)
+ case 209
+ document.write "set: "
+ printArray arrAny
+ oletest.AttrAny= arrAny
+ b= oletest.AttrAny
+ call printArrayEx( "<br> get: ", "<br>", b)
+
+ case 210
+ document.write "set: <br>"
+ printArray2 arrDim2Int :
+ oletest.AttrSequence= arrDim2Int
+ ret= oletest.AttrSequence
+ document.write "get: "
+ for each val in ret
+ document.write "<br> array: "
+ for each val2 in val
+ document.write val2
+ next
+ next
+
+ case 300
+ dim aByte
+ aByte= 100
+ call oletest.testinout_methodByte( aByte)
+ MsgBox aByte
+
+ end select
+end sub
+sub printArray( arr)
+ document.write "array: "
+ For Each val In arr
+ document.write CStr(val) & " "
+ Next
+end sub
+
+// print a 2 dimensional Array
+
+sub printArray2( arr)
+ elements1= UBound( arr, 1) - LBound( arr, 1) +1
+ elements2= UBound( arr, 2) - LBound( arr, 2) +1
+
+ For i=0 To elements1 -1
+ document.write( "array " & CStr( i) & ": " )
+ For j=0 To elements2 -1
+ document.write CStr( arr(i,j))
+ Next
+ document.write( "<br>")
+ Next
+end sub
+
+sub printArrayEx( pre, post, array)
+ document.write pre
+ printArray array
+ document.write post
+end sub
+</script>
+
+<div id=out> </div>
+
+<!-- Insert HTML here -->
+
+<h2> JScript </h2>
+Tests Array/Sequence conversion.<br>
+All methods receive a Sequence as Parameter. The element type of the Sequence is written on the buttons.
+<br>
+<button onclick='callOleTest( 1)'>byte</Button>
+<button onclick='callOleTest( 14)'>float</Button>
+<button onclick='callOleTest( 2)'>double</Button>
+<button onclick='callOleTest( 3)'>boolean</Button>
+<button onclick='callOleTest( 4)'>short</Button>
+<button onclick='callOleTest( 5)'>unsigned short</Button>
+<button onclick='callOleTest( 6)'>long</Button>
+<button onclick='callOleTest( 7)'>unsigned long</Button>
+<button onclick='callOleTest( 8)'>char</Button>
+<button onclick='callOleTest( 9)'>string</Button>
+<button onclick='callOleTest( 10)'>any</Button>
+<button onclick='callOleTest( 11)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 12)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 13)'>XInterface</Button>
+
+<p>
+
+<p>
+Out Parameter <br>
+<button onclick='callOleTest( 2000)'>byte </Button>
+<button onclick='callOleTest( 2016)'>float</Button>
+<button onclick='callOleTest( 2001)'>double</Button>
+<button onclick='callOleTest( 2002)'>boolean</Button>
+<button onclick='callOleTest( 2003)'>short</Button>
+<button onclick='callOleTest( 2004)'>unsigned short</Button>
+<button onclick='callOleTest( 2005)'>long</Button>
+<button onclick='callOleTest( 2006)'>unsigned long</Button>
+<button onclick='callOleTest( 2007)'>char</Button>
+<button onclick='callOleTest( 2008)'>string</Button>
+<button onclick='callOleTest( 2009)'>any</Button>
+<button onclick='callOleTest( 2010)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 2011)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 2012)'>2 out </Button>
+<button onclick='callOleTest( 2013)'>3 out </Button>
+<button onclick='callOleTest( 2014)'>1 in & 1 out </Button>
+<button onclick='callOleTest( 2015)'>XInterface </Button>
+<button onclick='callOleTest( 2017)'>mixed out and in </Button>
+
+
+<p>
+In Out Parameter <br>
+<button onclick='callOleTest( 500)'>byte </Button>
+<button onclick='callOleTest( 513)'>float</Button>
+<button onclick='callOleTest( 501)'>double</Button>
+<button onclick='callOleTest( 502)'>boolean</Button>
+<button onclick='callOleTest( 503)'>short</Button>
+<button onclick='callOleTest( 504)'>unsigned short</Button>
+<button onclick='callOleTest( 505)'>long</Button>
+<button onclick='callOleTest( 506)'>unsigned long</Button>
+<button onclick='callOleTest( 507)'>char</Button>
+<button onclick='callOleTest( 508)'>string</Button>
+<button onclick='callOleTest( 509)'>any</Button>
+<button onclick='callOleTest( 510)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 511)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<button onclick='callOleTest( 512)'>XInterface </Button>
+<p>
+
+Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
+ the element type of the Sequence is written on the buttons. <br>
+<button onclick='callOleTest( 200)'>byte </Button>
+<button onclick='callOleTest( 212)'>float</Button>
+<button onclick='callOleTest( 201)'>double</Button>
+<button onclick='callOleTest( 202)'>boolean</Button>
+<button onclick='callOleTest( 203)'>short</Button>
+<button onclick='callOleTest( 204)'>unsigned short</Button>
+<button onclick='callOleTest( 205)'>long</Button>
+<button onclick='callOleTest( 206)'>unsigned long</Button>
+<button onclick='callOleTest( 207)'>char</Button>
+<button onclick='callOleTest( 208)'>string</Button>
+<button onclick='callOleTest( 209)'>any</Button>
+<button onclick='callOleTest( 210)'>sequence&ltlong&gt </Button>
+<button onclick='callOleTest( 211)'>sequence&ltsequence&ltlong&gt &gt </Button>
+<p>
+
+Test of Any parameter in a method. Any contains:<br>
+<button onclick='callOleTest( 1000)'>integer </Button>
+<button onclick='callOleTest( 1001)'>double </Button>
+<button onclick='callOleTest( 1002)'>string</Button>
+<button onclick='callOleTest( 1003)'>array</Button>
+<button onclick='callOleTest( 1004)'>object</Button>
+<p>
+Test of Any parameter in a property. Any contains:<br>
+<button onclick='callOleTest( 1010)'>integer </Button>
+<button onclick='callOleTest( 1011)'>double </Button>
+<button onclick='callOleTest( 1012)'>string</Button>
+<button onclick='callOleTest( 1013)'>array</Button>
+<button onclick='callOleTest( 1014)'>object</Button>
+<P>
+<button onclick='callOleTest( 1020)'>[in] float </Button>
+
+
+
+<p>
+
+
+<h2> Visual Basic Tests </h2>
+Test array /Sequence conversion and return value<br>
+Template: <b> Sequence &lt type &gt method( Sequence&lt type &gt ) </b> <br>
+<!--<font color= red>Multi dimensional arrays are not processed by VBSript</font> <br> -->
+<button onclick='callBasic(0)'>byte</button>
+<button onclick='callBasic(1)'>double</button>
+<button onclick='callBasic(2)'>boolean</button>
+<button onclick='callBasic(3)'>short</button>
+<button onclick='callBasic(4)'>u short</button>
+<button onclick='callBasic(5)'>long</button>
+<button onclick='callBasic(6)'>u long</button>
+<button onclick='callBasic(7)'>string</button>
+<button onclick='callBasic(8)'>char</button>
+<button onclick='callBasic(9)'>any</button> <br>
+<button onclick='callBasic(10)'>Seq &lt int &gt</button> <br>
+
+
+IN/Out parameter <br>
+Template: <b> void method( Sequence &lt type &gt ) </b> <br>
+<button onclick='callBasic(100)'>byte</button>
+<button onclick='callBasic(101)'>double</button>
+<button onclick='callBasic(102)'>boolean</button>
+<button onclick='callBasic(103)'>short</button>
+<button onclick='callBasic(104)'>u short</button>
+<button onclick='callBasic(105)'>long</button>
+<button onclick='callBasic(106)'>u long</button>
+<button onclick='callBasic(107)'>string</button>
+<button onclick='callBasic(108)'>char</button>
+<button onclick='callBasic(109)'>any</button> <br>
+
+Simple out parameter<br>
+<button onclick='callBasic(150)'>byte</button>
+<!--<button onclick='callBasic(151)'>double</button>
+<button onclick='callBasic(152)'>boolean</button>
+<button onclick='callBasic(153)'>short</button>
+<button onclick='callBasic(155)'>long</button>
+<button onclick='callBasic(157)'>string</button>
+<button onclick='callBasic(158)'>char</button>
+<button onclick='callBasic(159)'>any</button> <br>
+//-->
+<br>
+
+
+Tests Array/Sequence conversion with <b>Attributes</b>. All params are of type Sequence and
+ the element type of the Sequence is written on the buttons. <br>
+<button onclick='callBasic( 200)'>byte </Button>
+<button onclick='callBasic( 201)'>double</Button>
+<button onclick='callBasic( 202)'>boolean</Button>
+<button onclick='callBasic( 203)'>short</Button>
+<button onclick='callBasic( 204)'>unsigned short</Button>
+<button onclick='callBasic( 205)'>long</Button>
+<button onclick='callBasic( 206)'>unsigned long</Button>
+<button onclick='callBasic( 207)'>string</Button>
+<button onclick='callBasic( 208)'>char</Button>
+<button onclick='callBasic( 209)'>any</Button>
+<button onclick='callBasic( 210)'>sequence&ltlong&gt </Button> <br>
+
+In Out parameter <br>
+<button onclick='callBasic( 300)'>byte</Button>
+
+
+
diff --git a/extensions/test/ole/callUnoToJava.htm b/extensions/test/ole/callUnoToJava.htm
new file mode 100644
index 000000000000..c5ceabf152ce
--- /dev/null
+++ b/extensions/test/ole/callUnoToJava.htm
@@ -0,0 +1,516 @@
+<HTML>
+<HEAD>
+<META NAME="GENERATOR" Content="Microsoft Developer Studio">
+<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
+<TITLE>Document Title</TITLE>
+</HEAD>
+<BODY id=theBody>
+
+<script language="JScript">
+function callOleTest( id)
+{
+ var factory= new ActiveXObject("com.sun.star.ServiceManager");
+ var oletest= factory.createInstance("oletest.OleTest");
+// alert(oletest);
+
+ switch( id)
+ {
+ case 1: // Test simple call of JScript object function from UNO
+ oletest.testInterface( new XCallback_Impl, 1);
+ break;
+
+ case 2:
+ // return value is the parameter object
+ oletest.testInterface( new XCallback_Impl, 2);
+ break;
+ //##################################################
+ // OUT parameter
+ //##################################################
+ case 3: // Test out parameter of type interface
+ oletest.testInterface( new XCallback_Impl, 3);
+ break;
+ case 4: // Test out parameter of type struct
+ oletest.testInterface( new XCallback_Impl, 4);
+ break;
+ case 5: // Test out parameter of type enum
+ oletest.testInterface( new XCallback_Impl, 5);
+ break;
+ case 6: // Test out parameter of type sequence<any>
+ oletest.testInterface( new XCallback_Impl, 6);
+ break;
+ case 7: // Test out parameter of type any
+ oletest.testInterface( new XCallback_Impl, 7);
+ break;
+ case 8: // Test out parameter of type bool
+ oletest.testInterface( new XCallback_Impl, 8);
+ break;
+ case 9: // Test out parameter of type char
+ oletest.testInterface( new XCallback_Impl, 9);
+ break;
+ case 10: // Test out parameter of type string
+ oletest.testInterface( new XCallback_Impl, 10);
+ break;
+ case 11: // Test out parameter of type float
+ oletest.testInterface( new XCallback_Impl, 11);
+ break;
+ case 12: // Test out parameter of type double
+ oletest.testInterface( new XCallback_Impl, 12);
+ break;
+ case 13: // Test out parameter of type byte
+ oletest.testInterface( new XCallback_Impl, 13);
+ break;
+ case 14: // Test out parameter of type short
+ oletest.testInterface( new XCallback_Impl, 14);
+ break;
+ case 15: // Test out parameter of type long
+ oletest.testInterface( new XCallback_Impl, 15);
+ break;
+ case 30: // outValuesMixed
+ oletest.testInterface( new XCallback_Impl, 30);
+ break;
+ case 31: // outValuesAll
+ oletest.testInterface( new XCallback_Impl, 31);
+ break;
+ //##################################################
+ // IN/OUT parameter
+ //##################################################
+
+ case 100: // inoutInterface
+ oletest.testInterface( new XCallback_Impl, 100);
+ break;
+ case 101: // inoutStruct
+ oletest.testInterface( new XCallback_Impl, 101);
+ break;
+ case 102: // inoutEnum
+ oletest.testInterface( new XCallback_Impl, 102);
+ break;
+ case 103: // inoutSeqAny
+ oletest.testInterface( new XCallback_Impl, 103);
+ break;
+ case 104: // inoutAny
+ oletest.testInterface( new XCallback_Impl, 104);
+ break;
+ case 105: // inoutBool
+ oletest.testInterface( new XCallback_Impl, 105);
+ break;
+ case 106: // inoutChar
+ oletest.testInterface( new XCallback_Impl, 106);
+ break;
+ case 107: // inoutString
+ oletest.testInterface( new XCallback_Impl, 107);
+ break;
+ case 108: // inoutFloat
+ oletest.testInterface( new XCallback_Impl, 108);
+ break;
+ case 109: // inoutDouble
+ oletest.testInterface( new XCallback_Impl, 109);
+ break;
+ case 110: // inoutByte
+ oletest.testInterface( new XCallback_Impl, 110);
+ break;
+ case 111: // inoutShort
+ oletest.testInterface( new XCallback_Impl, 111);
+ break;
+ case 112: // inoutLong
+ oletest.testInterface( new XCallback_Impl, 112);
+ break;
+ case 120: // inoutValuesAll
+ oletest.testInterface( new XCallback_Impl, 120);
+ break;
+ case 200: // inValues
+ oletest.testInterface( new XCallback_Impl, 200);
+ break;
+
+ case 1000:
+ oletest.testInterface2(new MultiInterface(), 0);
+ break;
+ }
+
+}
+
+
+
+// The class --------------------------------------------
+
+function XCallback_Impl()
+{
+
+ // XCallback
+ this._environment= "JScript";
+
+ this.func1= XCallback_Impl_func1;
+ this.returnInterface= XCallback_Impl_returnInterface;
+ // #################################################
+ // OUT parameter
+ //###################################################
+ this.outInterface= XCallback_Impl_outInterface;
+ this.outStruct= XCallback_Impl_outStruct;
+ this.outEnum= XCallback_Impl_outEnum;
+ this.outSeqAny= XCallback_Impl_outSeqAny;
+ this.outAny= XCallback_Impl_outAny;
+ this.outBool= XCallback_Impl_outBool;
+ this.outChar= XCallback_Impl_outChar;
+ this.outString= XCallback_Impl_outString;
+ this.outFloat= XCallback_Impl_outFloat;
+ this.outDouble= XCallback_Impl_outDouble;
+ this.outByte= XCallback_Impl_outByte;
+ this.outShort= XCallback_Impl_outShort;
+ this.outLong= XCallback_Impl_outLong;
+ this.outValuesMixed= XCallback_Impl_outValuesMixed;
+ this.outValuesAll= XCallback_Impl_outValuesAll;
+ // #################################################
+ // IN/ OUT parameter
+ //###################################################
+ this.inoutInterface= XCallback_Impl_inoutInterface;
+ this.inoutStruct= XCallback_Impl_inoutStruct;
+ this.inoutEnum= XCallback_Impl_inoutEnum;
+ this.inoutSeqAny= XCallback_Impl_inoutSeqAny;
+ this.inoutAny= XCallback_Impl_inoutAny;
+ this.inoutBool= XCallback_Impl_inoutBool;
+ this.inoutChar= XCallback_Impl_inoutChar;
+ this.inoutString= XCallback_Impl_inoutString;
+ this.inoutFloat= XCallback_Impl_inoutFloat;
+ this.inoutDouble= XCallback_Impl_inoutDouble;
+ this.inoutByte= XCallback_Impl_inoutByte;
+ this.inoutShort= XCallback_Impl_inoutShort;
+ this.inoutLong= XCallback_Impl_inoutLong;
+ this.inoutValuesAll= XCallback_Impl_inoutValuesAll;
+ // #################################################
+ // IN parameter
+ //##################################################
+ this.inValues= XCallback_Impl_inValues;
+
+}
+
+
+function XCallback_Impl_func1()
+{
+ alert("XCallback_Impl_func1");
+}
+function XCallback_Impl_returnInterface()
+{
+ alert("XCallback::returnInterface called");
+ return new XSimple_Impl();
+}
+
+function XCallback_Impl_outInterface( outVal)
+{
+ outVal[0]= new XSimple_Impl();
+}
+
+function XCallback_Impl_outLong( outVal)
+{
+ alert("outLong");
+}
+function XCallback_Impl_outStruct( outVal)
+{
+ var factory= new ActiveXObject("com.sun.star.ServiceManager");
+ var starCoreReflection = factory.createInstance("com.sun.star.reflection.CoreReflection");
+ var structClass = starCoreReflection.forName("oletest.SimpleStruct");
+ var outParam= new Array();
+ structClass.createObject(outParam);
+ var aStruct= outParam[0];
+ aStruct.message= "a Struct created in JScript";
+ outVal[0]= aStruct;
+
+}
+function XCallback_Impl_outEnum( outVal)
+{
+ outVal[0]= 2;
+}
+function XCallback_Impl_outSeqAny( outVal)
+{
+ var ar= new Array(1,2,3);
+ outVal[0]= ar;
+}
+function XCallback_Impl_outAny( outVal)
+{
+ outVal[0]= "this is an Any";
+}
+function XCallback_Impl_outBool( outVal)
+{
+ outVal[0]= true;
+}
+function XCallback_Impl_outChar( outVal)
+{
+ outVal[0]= "a";
+}
+function XCallback_Impl_outString( outVal)
+{
+ outVal[0]= "This string was created in JScript";
+}
+function XCallback_Impl_outFloat( outVal)
+{
+ outVal[0]= 3.14;
+}
+function XCallback_Impl_outDouble( outVal)
+{
+ outVal[0]= 3.145;
+}
+function XCallback_Impl_outByte( outVal)
+{
+ outVal[0]= 100;
+}
+function XCallback_Impl_outShort( outVal)
+{
+ outVal[0]= 1000;
+}
+function XCallback_Impl_outLong( outVal)
+{
+ outVal[0]= 1000000;
+}
+function XCallback_Impl_outValuesMixed( inLong, outLong, inString)
+{
+ alert("inVal long: " + inLong +" inString:" + inString);
+ outLong[0]= inLong + 1;
+}
+function XCallback_Impl_outValuesAll( xSimple, aSimpleStruct, aSimpleEnum, seqAny, aAny, aBool,
+ aChar, aString, aFloat, aDouble, aByte, aShort, aLong)
+{
+ this.outInterface( xSimple);
+ this.outStruct( aSimpleStruct);
+ this.outEnum( aSimpleEnum);
+ this.outSeqAny( seqAny);
+ this.outAny( aAny);
+ this.outBool( aBool);
+ this.outChar( aChar);
+ this.outString( aString);
+ this.outFloat( aFloat);
+ this.outDouble( aDouble);
+ this.outByte( aByte);
+ this.outShort( aShort);
+ this.outLong( aLong);
+}
+
+function XCallback_Impl_inoutInterface( val)
+{
+ val[0].func("calling on in parameter");
+ val[0]= new XSimple_Impl();
+}
+function XCallback_Impl_inoutStruct( val)
+{
+ alert( val[0].message);
+ val[0].message= "property message changed in JScript";
+}
+function XCallback_Impl_inoutEnum(val)
+{
+ alert("enum value +" + val);
+ val[0]= 2;
+}
+function XCallback_Impl_inoutSeqAny( val)
+{
+ var vbar = new VBArray(val[0]);
+ var seq= vbar.toArray();
+ alert( seq[0] +" "+seq[1] +" " +seq[2]);
+ val[0]= new Array("jscript1", "jscript2","jscript3");
+}
+function XCallback_Impl_inoutAny(val)
+{
+ alert( "JScript in any: " + val[0]);
+ val[0]= "a string from JScript";
+}
+function XCallback_Impl_inoutBool(val)
+{
+ alert( "JScript in bool: " + val[0]);
+ val[0]= true;
+}
+function XCallback_Impl_inoutChar(val)
+{
+ alert( "JScript in char: " + val[0]);
+ val[0]= 'b';
+}
+function XCallback_Impl_inoutString(val)
+{
+ alert( "JScript in string: " + val[0]);
+ val[0]= " a JScript string";
+}
+function XCallback_Impl_inoutFloat(val)
+{
+ alert( "JScript in float: " + val[0]);
+ val[0]= 4.14;
+}
+function XCallback_Impl_inoutDouble(val)
+{
+ alert( "JScript in double: " + val[0]);
+ val[0]= 4.145;
+}
+
+function XCallback_Impl_inoutByte(val)
+{
+ alert( "JScript in byte: " + val[0]);
+ val[0]= 100;
+}
+function XCallback_Impl_inoutShort(val)
+{
+ alert( "JScript in short: " + val[0]);
+ val[0]= 1000;
+}
+function XCallback_Impl_inoutLong(val)
+{
+ alert( "JScript in long: " + val[0]);
+ val[0]= 100000;
+}
+function XCallback_Impl_inoutValuesAll(aXSimple, aStruct, aEnum, aSeq,
+ aAny, aBool, aChar, aString, aFloat, aDouble,
+ aByte, aShort, aLong )
+{
+ this.inoutInterface( aXSimple);
+ this.inoutStruct( aStruct);
+ this.inoutEnum( aEnum);
+ this.inoutSeqAny( aSeq);
+ this.inoutAny( aAny);
+ this.inoutBool( aBool);
+ this.inoutChar( aChar);
+ this.inoutString( aString);
+ this.inoutFloat( aFloat);
+ this.inoutDouble( aDouble);
+ this.inoutByte( aByte);
+ this.inoutShort( aShort);
+ this.inoutLong( aLong);
+}
+
+function XCallback_Impl_inValues( aChar, aLong, aString)
+{
+ alert( "char : " + aChar + " long: " + aLong + " string: " + aString);
+}
+
+
+//################################################################
+// class MultiInterface implements XSimple, XSimple2, XSimple3
+//################################################################
+function MultiInterface()
+{
+ this._environment= "JScript";
+ this._implementedInterfaces= new Array( "oletest.XSimple", "oletest.XSimple2", "oletest.XSimple3");
+ // XSimple ---------------
+ this.getName= MultiInterface_getName;
+ this.func= MultiInterface_func;
+ this.func2= MultiInterface_func2;
+ this.func3= MultiInterface_func3;
+ // XSimple2
+ this.getName2= MultiInterface_getName2;
+ // XSimple3
+ this.getName3= MultiInterface_getName3;
+}
+
+
+function MultiInterface_getName()
+{
+ return "JScript XSimple called";
+}
+function MultiInterface_func( message)
+{
+ alert("JScript object (XSimple)-- " + message);
+}
+
+function MultiInterface_getName2()
+{
+ return "JScript XSimple2 called";
+}
+function MultiInterface_func2( message)
+{
+ alert("JScript object (XSimple2) -- " + message);
+}
+
+function MultiInterface_getName3()
+{
+ return "JScript XSimple3 called";
+}
+function MultiInterface_func3( message)
+{
+ alert("JScript object (XSimple3) -- " + message);
+}
+
+
+
+
+//XCallback_Impl_outValuesMixed( val1, outval, val2)
+//{
+//}
+//XCallback_Impl_outValuesAll( xSimple, aSimpleStruct, aSimpleEnum, seqAny, aAny, aBool,
+// aChar, aString, aFloat, aDouble, aByte, aShort, aLong, aUShort, aULong)
+//{
+//
+//}
+
+
+
+// class XSimple_Impl----------------------------------------------------------------------
+function XSimple_Impl()
+{
+ //XSimple
+ this.func= XSimple_Impl_func;
+}
+function XSimple_Impl_func( message)
+{
+ alert( "XSimple called." + message);
+}
+
+
+</script>
+
+
+
+<h2> Object in JScript</h2>
+
+This test passes a XCallback to an UNO function of the UNO test control.
+XCallback is implemented by the JScript class XCallback_Impl. The function
+XCallback::func1 is then called from the UNO test control.
+<br>
+<button onclick='callOleTest( 1)'>go</Button>
+<br>
+On the UNO object the function testInterface is called which takes
+a XCallback as parameter. XCallback is implemented in a JScript object.The function
+returns a XSimple Interface. Then the UNO object calls XSimple::notify. This test shall
+verify the correct conversion of the return value( IDispatch JScript object) to an XSimple object.<br>
+<button onclick='callOleTest( 2)'>go</Button>
+<br>
+<h1> out parameter </h1>
+The a JScript object of class XCallback_Impl is passed to the UNO OleTest Control as parameter.
+According to the buttons the OleTest object calls a function on XCallback_Impl that has appropriate type
+as out parameter.<br>
+<button onclick='callOleTest( 3)'>interface</Button>
+<button onclick='callOleTest( 4)'>struct</Button>
+<button onclick='callOleTest( 5)'>enum</Button>
+<button onclick='callOleTest( 6)'>sequence&lt;any&gt;</Button>
+<button onclick='callOleTest( 7)'>any</Button>
+<button onclick='callOleTest( 8)'>bool</Button>
+<button onclick='callOleTest( 9)'>char</Button>
+<button onclick='callOleTest( 10)'>string</Button>
+<button onclick='callOleTest( 11)'>float</Button>
+<button onclick='callOleTest( 12)'>double</Button>
+<button onclick='callOleTest( 13)'>byte</Button>
+<button onclick='callOleTest( 14)'>short</Button>
+<button onclick='callOleTest( 15)'>long</Button>
+<br>
+Other test with out parameters <br>
+<button onclick='callOleTest( 30)'>outValuesMixed</Button>
+<button onclick='callOleTest( 31)'>outValuesAll</Button>
+<h1> in out parameter </h1>
+<button onclick='callOleTest( 100)'>interface</Button>
+<button onclick='callOleTest( 101)'>struct</Button>
+<button onclick='callOleTest( 102)'>enum</Button>
+<button onclick='callOleTest( 103)'>seqence&lt;any&gt;</Button>
+<button onclick='callOleTest( 104)'>any</Button>
+<button onclick='callOleTest( 105)'>bool</Button>
+<button onclick='callOleTest( 106)'>char</Button>
+<button onclick='callOleTest( 107)'>string</Button>
+<button onclick='callOleTest( 108)'>float</Button>
+<button onclick='callOleTest( 109)'>double</Button>
+<button onclick='callOleTest( 110)'>byte</Button>
+<button onclick='callOleTest( 111)'>short</Button>
+<button onclick='callOleTest( 112)'>long</Button>
+<br>
+Other tests with inout parameters <br>
+<button onclick='callOleTest( 120)'>inoutValuesAll</Button>
+<h1>in parameters </h1>
+<button onclick='callOleTest( 200)'>inValues</Button>
+
+<h1> JScript object implements several interfaces </h1>
+<button onclick='callOleTest( 1000)'>go</Button>
+
+
+</body>
+</html>
+
+
diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx
new file mode 100644
index 000000000000..beb7d9b1308c
--- /dev/null
+++ b/extensions/test/ole/cpnt/cpnt.cxx
@@ -0,0 +1,1545 @@
+/*************************************************************************
+ *
+ * $RCSfile: cpnt.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <windows.h>
+#include <atlbase.h>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <osl/diagnose.h>
+#include <uno/environment.h>
+#include <cppuhelper/factory.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/reflection/XIdlReflection.hpp>
+
+
+#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/uno/Reference.h>
+#include <rtl/ustring>
+#include <com/sun/star/uno/Reference.hxx>
+#include <oletest/XTestSequence.hpp>
+#include <oletest/XTestStruct.hpp>
+#include <oletest/XTestOther.hpp>
+#include <oletest/XTestInterfaces.hpp>
+#include <oletest/XSimple.hpp>
+#include <oletest/XSimple2.hpp>
+#include <oletest/XSimple3.hpp>
+
+#include <com/sun/star/beans/Property.hpp>
+using namespace cppu;
+using namespace osl;
+using namespace oletest;
+using namespace rtl;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::registry;
+using namespace com::sun::star::script;
+using namespace com::sun::star::reflection;
+
+#define IMPL_NAME L"oletest.OleTestImpl" // oletest.OleTestImpl in applicat.rdb
+#define SERVICE_NAME L"oletest.OleTest"
+#define KEY1 L"/oletest.OleTestImpl/UNO/SERVICES"
+#define KEY2 L"oletest.OleTest"
+
+class OComponent : public WeakImplHelper5<
+ XTestSequence, XTestStruct, XTestOther, XTestInterfaces, XSimple>
+{
+ sal_Int32 m_arrayConstructor;
+ Reference<XMultiServiceFactory> m_rFactory;
+
+ Sequence<sal_Int8> m_seqByte;
+ Sequence<float> m_seqFloat;
+ Sequence<double> m_seqDouble;
+ Sequence<sal_Bool> m_seqBool;
+ Sequence<sal_Int16> m_seqShort;
+ Sequence<sal_uInt16> m_seqUShort;
+ Sequence<sal_Int32> m_seqLong;
+ Sequence<sal_uInt32> m_seqULong;
+ Sequence<sal_Unicode> m_seqChar;
+ Sequence<OUString> m_seqString;
+ Sequence<Any> m_seqAny;
+ Sequence<Sequence< sal_Int32> > m_seq1;
+ Sequence<Sequence< Sequence< sal_Int32> > > m_seq2;
+ Any m_any;
+ Sequence<Reference< XInterface > > m_seqxInterface;
+public:
+ OComponent( const Reference<XMultiServiceFactory> & rFactory ) :
+ m_rFactory( rFactory ), m_arrayConstructor(0) {}
+ ~OComponent();
+
+public: // refcounting
+// sal_Bool queryInterface( Uik aUik, XInterfaceRef & rOut );
+// void acquire() { OWeakObject::acquire(); }
+// void release() { OWeakObject::release(); }
+// void* getImplementation(Reflection *p) { return OWeakObject::getImplementation(p); }
+
+public: // XTestSequence
+ virtual Sequence<sal_Int8> SAL_CALL methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException );
+ virtual Sequence<float> SAL_CALL methodFloat(const Sequence< float >& aSeq) throw( RuntimeException );
+ virtual Sequence< double > SAL_CALL methodDouble(const Sequence< double >& aSeq) throw( RuntimeException);
+ virtual Sequence< sal_Bool > SAL_CALL methodBool(const Sequence< sal_Bool >& aSeq) throw( RuntimeException );
+ virtual Sequence< sal_Int16 > SAL_CALL methodShort(const Sequence< sal_Int16 >& aSeq) throw( RuntimeException );
+ virtual Sequence< sal_uInt16 > SAL_CALL methodUShort(const Sequence< sal_uInt16 >& aSeq) throw( RuntimeException );
+ virtual Sequence< sal_Int32 > SAL_CALL methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException) ;
+ virtual Sequence< sal_uInt32 > SAL_CALL methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException );
+ virtual Sequence< OUString > SAL_CALL methodString(const Sequence< OUString >& aSeq) throw( RuntimeException );
+ virtual Sequence< sal_Unicode > SAL_CALL methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException );
+ virtual Sequence< Any > SAL_CALL methodAny(const Sequence< Any >& aSeq) throw( RuntimeException );
+ virtual Sequence< Reference< XInterface > > SAL_CALL methodXInterface( const Sequence< Reference< XInterface > >& aSeq ) throw(RuntimeException) ;
+ virtual Sequence< Sequence< sal_Int32 > > SAL_CALL methodSequence(const Sequence< Sequence< sal_Int32 > >& aSeq) throw( RuntimeException );
+ virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL methodSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq) throw( RuntimeException );
+
+ virtual Sequence< sal_Int8 > SAL_CALL getAttrByte(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrByte(const Sequence< sal_Int8 >& AttrByte_) throw( RuntimeException );
+ virtual Sequence< float > SAL_CALL getAttrFloat(void) throw( RuntimeException) ;
+ virtual void SAL_CALL setAttrFloat(const Sequence< float >& AttrFloat_) throw( RuntimeException );
+ virtual Sequence< double > SAL_CALL getAttrDouble(void) throw( RuntimeException) ;
+ virtual void SAL_CALL setAttrDouble(const Sequence< double >& AttrDouble_) throw( RuntimeException );
+ virtual Sequence< sal_Bool > SAL_CALL getAttrBool(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrBool(const Sequence< sal_Bool >& AttrBool_) throw( RuntimeException );
+ virtual Sequence< sal_Int16 > SAL_CALL getAttrShort(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrShort(const Sequence< sal_Int16 >& AttrShort_) throw( RuntimeException );
+ virtual Sequence< sal_uInt16 > SAL_CALL getAttrUShort(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrUShort(const Sequence< sal_uInt16 >& AttrUShort_) throw( RuntimeException );
+ virtual Sequence< sal_Int32 > SAL_CALL getAttrLong(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrLong(const Sequence< sal_Int32 >& AttrLong_) throw( RuntimeException );
+ virtual Sequence< sal_uInt32 > SAL_CALL getAttrULong(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrULong(const Sequence< sal_uInt32 >& AttrULong_) throw( RuntimeException );
+ virtual Sequence< OUString > SAL_CALL getAttrString(void) throw(RuntimeException );
+ virtual void SAL_CALL setAttrString(const Sequence< OUString >& AttrString_) throw( RuntimeException );
+ virtual Sequence< sal_Unicode > SAL_CALL getAttrChar(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrChar(const Sequence< sal_Unicode >& AttrChar_) throw( RuntimeException );
+ virtual Sequence< Any > SAL_CALL getAttrAny(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrAny(const Sequence< Any >& AttrAny_) throw( RuntimeException );
+ virtual Sequence< Sequence< sal_Int32 > > SAL_CALL getAttrSequence(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrSequence(const Sequence< Sequence< sal_Int32 > >& AttrSequence_) throw( RuntimeException );
+ virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL getAttrSequence2(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& AttrSequence2_) throw ( RuntimeException );
+ virtual Sequence< Reference< XInterface > > SAL_CALL getAttrXInterface() throw(RuntimeException);
+ virtual void SAL_CALL setAttrXInterface( const Sequence< Reference< XInterface > >& _attrxinterface ) throw(RuntimeException);
+
+ virtual void SAL_CALL testout_methodByte(sal_Int8& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodFloat(float& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodDouble(double& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodBool(sal_Bool& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodShort(sal_Int16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodUShort(sal_uInt16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodLong(sal_Int32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodULong(sal_uInt32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodString(OUString& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodChar(sal_Unicode& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodAny(Any& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException );
+ virtual void SAL_CALL testout_methodMulParams4( float in1, float& out1, sal_Int32 in2, sal_Int32& out2, sal_Int32 in3 ) throw(RuntimeException);
+ virtual void SAL_CALL testout_methodXInterface( Reference< XInterface >& rOut ) throw(RuntimeException);
+
+ virtual void SAL_CALL testinout_methodByte(sal_Int8& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodFloat(float& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodDouble(double& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodBool(sal_Bool& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodShort(sal_Int16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodUShort(sal_uInt16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodLong(sal_Int32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodULong(sal_uInt32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodString(OUString& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodAny(Any& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL testinout_methodXInterface( Reference< XInvocation >& rOut ) throw(RuntimeException);
+ virtual Any SAL_CALL methodAnyTest1(const Any& rIn) throw( RuntimeException ) ;
+ virtual Any SAL_CALL getAttrAny2(void) throw( RuntimeException ) ;
+ virtual void SAL_CALL setAttrAny2(const Any& AttrAny2_) throw( RuntimeException ) ;
+
+
+ // XTestStruct
+ virtual void SAL_CALL methodStruct(const Property& aProp) throw( RuntimeException );
+
+ virtual Property SAL_CALL retMethodStruct(void) throw( RuntimeException );
+
+ virtual Property SAL_CALL getAttrStruct(void) throw( RuntimeException );
+ virtual void SAL_CALL setAttrStruct(const Property& AttrStruct_) throw( RuntimeException );
+
+ // XTestOther
+ virtual void SAL_CALL other_methodAnyIn(const Any& rAny) throw( RuntimeException );
+ virtual void SAL_CALL other_methodAnyOut(Any& rAny) throw( RuntimeException );
+ virtual Any SAL_CALL other_methodAnyRet(void) throw( RuntimeException );
+ virtual void SAL_CALL in_float( float val) throw ( RuntimeException);
+
+ // XTestOutParameters ------------------------------------------------------------------------
+ virtual void SAL_CALL out_test(sal_Int8 rIn) throw( RuntimeException );
+
+ virtual void SAL_CALL out_methodByte(sal_Int8& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodFloat(float& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodDouble(double& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodBool(sal_Bool& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodShort(sal_Int16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodUShort(sal_uInt16& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodLong(sal_Int32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodULong(sal_uInt32& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodString(OUString& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodChar(sal_Unicode& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodAny(Any& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException );
+ virtual void SAL_CALL out_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException );
+ virtual void SAL_CALL out_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException );
+ virtual void SAL_CALL out_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException );
+
+ // XTestInterfaces --------------------------------------------------------------------------
+ virtual void SAL_CALL testInterface( const Reference< XCallback >& xCallback, sal_Int32 mode ) throw(RuntimeException);
+ virtual void SAL_CALL testInterface2( const Reference< XSimple >& xSimple, sal_Int32 mode ) throw(RuntimeException);
+ // XSimple --------------------------------------------------------------------------
+ void SAL_CALL func( const OUString &message) throw(::com::sun::star::uno::RuntimeException);
+ OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
+
+};
+
+
+OComponent::~OComponent()
+{
+}
+
+
+// Funktions ==============================================================================
+
+Reference<XInterface> SAL_CALL OComponent_CreateInstance( const Reference<XMultiServiceFactory> & rSMgr ) throw(RuntimeException)
+{
+ Reference<XInterface> xService = *new OComponent( rSMgr );
+ return xService;
+}
+
+Sequence<OUString> OComponent_getSupportedServiceNames(void)
+{
+ Sequence<OUString> aRet(1);
+ aRet.getArray()[0] = SERVICE_NAME;//ODataInputStream_getImplementationName();
+
+ return aRet;
+}
+
+
+extern "C" sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey )
+{
+ if(pRegistryKey)
+ {
+ try
+ {
+ Reference<XRegistryKey> xNewKey =
+ reinterpret_cast<XRegistryKey*>( pRegistryKey)->createKey(KEY1);
+ xNewKey->createKey( KEY2);
+ return sal_True;
+
+ }
+ catch(InvalidRegistryException &)
+ {
+ OSL_ENSHURE( sal_False, "### InvalidRegistryException!\n");
+ }
+ }
+ return sal_False;
+}
+
+extern "C" void * SAL_CALL component_getFactory(
+ const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
+{
+ static void * pRet= NULL;
+ if( ! pRet)
+ {
+ OUString aImplName( OUString::createFromAscii( pImplName ) );
+ if (pServiceManager && aImplName.equals( IMPL_NAME ))
+ {
+ Reference<XMultiServiceFactory> xMulFac(
+ reinterpret_cast< XMultiServiceFactory*>(pServiceManager));
+
+ Sequence<OUString> seqServiceNames;
+ Reference<XSingleServiceFactory> xFactory = createOneInstanceFactory( xMulFac, SERVICE_NAME,
+ OComponent_CreateInstance, seqServiceNames);
+
+ if (xFactory.is())
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+ }
+ return pRet;
+}
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+
+// XTestSequence ============================================================================
+Sequence<sal_Int8> SAL_CALL OComponent::methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException )
+{
+ sal_Int8 _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence<float> SAL_CALL OComponent::methodFloat(const Sequence< float>& aSeq) throw( RuntimeException )
+{
+ float _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence<double> SAL_CALL OComponent::methodDouble(const Sequence< double >& aSeq) throw( RuntimeException)
+{
+ double _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_Bool > SAL_CALL OComponent::methodBool(const Sequence< sal_Bool >& aSeq) throw( RuntimeException)
+{
+ sal_Bool _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_Int16 > SAL_CALL OComponent::methodShort(const Sequence< sal_Int16 >& aSeq) throw( RuntimeException )
+{
+ sal_Int16 _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_uInt16 > SAL_CALL OComponent::methodUShort(const Sequence< sal_uInt16 >& aSeq) throw( RuntimeException )
+{
+ sal_uInt16 _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException)
+{
+ sal_Int32 _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++) {
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException)
+{
+ sal_uInt32 _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString >& aSeq) throw( RuntimeException)
+{
+ OUString _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++) {
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException)
+{
+ sal_Unicode _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ }
+ return aSeq;
+}
+Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) throw( RuntimeException)
+{
+ Any _x;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ _x= aSeq.getConstArray()[i];
+ TypeClass _t= _x.getValueTypeClass();
+ if( _t== TypeClass_STRING)
+ OUString s(* (rtl_uString**)_x.getValue());
+ }
+ return aSeq;
+
+}
+//Sequence< Reference< XInterface> > SAL_CALL methodXInterface ( const Sequence< Reference < XInterface> >& aSeq)
+// throw (RuntimeException)
+Sequence< Reference< XInterface > > SAL_CALL OComponent::methodXInterface( const Sequence< Reference< XInterface > >& aSeq ) throw(RuntimeException)
+{
+ return aSeq;
+}
+
+Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::methodSequence(const Sequence< Sequence< sal_Int32 > >& aSeq) throw( RuntimeException)
+{
+ sal_Int32 value;
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ const Sequence<sal_Int32>& rseq2= aSeq.getConstArray()[i];
+ for (sal_Int16 j= 0; j < rseq2.getLength(); j++){
+ value= rseq2.getConstArray()[j];
+ }
+ }
+ return aSeq;
+}
+Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::methodSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq)
+ throw( RuntimeException )
+{
+ sal_Int32 value;
+ sal_Int32 len= aSeq.getLength();
+ for( sal_Int16 i= 0; i < aSeq.getLength(); i++){
+ const Sequence< Sequence<sal_Int32> >& rseq2= aSeq.getConstArray()[i];
+ len= rseq2.getLength();
+
+ for (sal_Int16 j= 0; j < rseq2.getLength(); j++){
+ const Sequence<sal_Int32> & rseq3= rseq2.getConstArray()[j];
+ len= rseq3.getLength();
+
+ for (sal_Int16 k= 0; k < rseq3.getLength(); k++)
+ value= rseq3.getConstArray()[k];
+ }
+ }
+ return aSeq;
+}
+
+
+
+//---------------------------------------------------------------------------------------------
+
+Sequence< sal_Int8 > SAL_CALL OComponent::getAttrByte(void) throw( RuntimeException)
+{
+ return m_seqByte;
+}
+void SAL_CALL OComponent::setAttrByte(const Sequence< sal_Int8 >& AttrByte_) throw( RuntimeException )
+{
+ m_seqByte= AttrByte_;
+}
+Sequence< float > SAL_CALL OComponent::getAttrFloat(void) throw( RuntimeException )
+{
+ return m_seqFloat;
+}
+void SAL_CALL OComponent::setAttrFloat(const Sequence< float >& AttrFloat_) throw( RuntimeException )
+{
+ m_seqFloat= AttrFloat_;
+}
+
+Sequence< double > SAL_CALL OComponent::getAttrDouble(void) throw( RuntimeException )
+{
+ return m_seqDouble;
+}
+void SAL_CALL OComponent::setAttrDouble(const Sequence< double >& AttrDouble_) throw( RuntimeException )
+{
+ m_seqDouble= AttrDouble_;
+}
+
+Sequence< sal_Bool > SAL_CALL OComponent::getAttrBool(void) throw( RuntimeException)
+{
+ return m_seqBool;
+}
+
+void SAL_CALL OComponent::setAttrBool(const Sequence< sal_Bool >& AttrBool_) throw (RuntimeException )
+{
+ m_seqBool= AttrBool_;
+}
+
+Sequence< sal_Int16 > SAL_CALL OComponent::getAttrShort(void) throw( RuntimeException)
+{
+ return m_seqShort;
+}
+void SAL_CALL OComponent::setAttrShort(const Sequence< sal_Int16 >& AttrShort_) throw( RuntimeException )
+{
+ m_seqShort= AttrShort_;
+}
+
+Sequence< sal_uInt16 > SAL_CALL OComponent::getAttrUShort(void) throw( RuntimeException )
+{
+ return m_seqUShort;
+}
+void SAL_CALL OComponent::setAttrUShort(const Sequence< sal_uInt16 >& AttrUShort_) throw( RuntimeException )
+{
+ m_seqUShort= AttrUShort_;
+}
+
+Sequence< sal_Int32 > SAL_CALL OComponent::getAttrLong(void) throw( RuntimeException)
+{
+ return m_seqLong;
+}
+void SAL_CALL OComponent::setAttrLong(const Sequence< sal_Int32 >& AttrLong_) throw( RuntimeException )
+{
+ m_seqLong= AttrLong_;
+}
+
+Sequence< sal_uInt32 > SAL_CALL OComponent::getAttrULong(void) throw( RuntimeException )
+{
+ return m_seqULong;
+}
+void SAL_CALL OComponent::setAttrULong(const Sequence< sal_uInt32 >& AttrULong_) throw( RuntimeException )
+{
+ m_seqULong= AttrULong_;
+}
+
+Sequence< OUString > SAL_CALL OComponent::getAttrString(void) throw( RuntimeException )
+{
+ return m_seqString;
+}
+void SAL_CALL OComponent::setAttrString(const Sequence< OUString >& AttrString_) throw( RuntimeException )
+{
+ m_seqString= AttrString_;
+}
+
+Sequence< sal_Unicode > SAL_CALL OComponent::getAttrChar(void) throw( RuntimeException )
+{
+ return m_seqChar;
+}
+void SAL_CALL OComponent::setAttrChar(const Sequence< sal_Unicode >& AttrChar_) throw( RuntimeException)
+{
+ m_seqChar= AttrChar_;
+}
+
+Sequence< Any > SAL_CALL OComponent::getAttrAny(void) throw( RuntimeException)
+{
+ return m_seqAny;
+}
+void SAL_CALL OComponent::setAttrAny(const Sequence< Any >& AttrAny_) throw( RuntimeException )
+{
+ m_seqAny= AttrAny_;
+}
+
+Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::getAttrSequence(void) throw( RuntimeException)
+{
+ return m_seq1;
+}
+void SAL_CALL OComponent::setAttrSequence(const Sequence< Sequence< sal_Int32 > >& AttrSequence) throw(RuntimeException )
+{
+ sal_Int32 x= 0;
+ for( sal_Int32 i=0; i < AttrSequence.getLength(); i++)
+ {
+ Sequence< sal_Int32 > seq= AttrSequence[i];
+
+ for ( sal_Int32 j=0; j < seq.getLength(); j++)
+ {
+ x= seq[j];
+ }
+ }
+
+ m_seq1= AttrSequence;
+}
+
+Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::getAttrSequence2(void) throw( RuntimeException )
+{
+ return m_seq2;
+}
+void SAL_CALL OComponent::setAttrSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& AttrSequence2_)
+ throw( RuntimeException )
+{
+ m_seq2= AttrSequence2_;
+}
+
+Sequence< Reference< XInterface > > SAL_CALL OComponent::getAttrXInterface() throw(RuntimeException)
+{
+ return m_seqxInterface;
+}
+void SAL_CALL OComponent::setAttrXInterface( const Sequence< Reference< XInterface > >& _attrxinterface ) throw(RuntimeException)
+{
+ m_seqxInterface= _attrxinterface;
+}
+
+// ----------------------------------------------------------------------------
+
+void SAL_CALL OComponent::testout_methodByte(sal_Int8& rOut) throw( RuntimeException )
+{
+ rOut= 111;
+}
+void SAL_CALL OComponent::testout_methodFloat(float& rOut) throw( RuntimeException )
+{
+ rOut= 3.14;
+}
+void SAL_CALL OComponent::testout_methodDouble(double& rOut) throw( RuntimeException )
+{
+ rOut= 3.14;
+}
+
+void SAL_CALL OComponent::testout_methodBool(sal_Bool& rOut) throw( RuntimeException )
+{
+ rOut= sal_True;
+}
+void SAL_CALL OComponent::testout_methodShort(sal_Int16& rOut) throw( RuntimeException )
+{
+ rOut= 222;
+}
+void SAL_CALL OComponent::testout_methodUShort(sal_uInt16& rOut) throw( RuntimeException )
+{
+ rOut= 333;
+}
+void SAL_CALL OComponent::testout_methodLong(sal_Int32& rOut) throw( RuntimeException )
+{
+ rOut = 444;
+}
+void SAL_CALL OComponent::testout_methodULong(sal_uInt32& rOut) throw( RuntimeException )
+{
+ rOut= 555;
+}
+void SAL_CALL OComponent::testout_methodString(OUString& rOut) throw( RuntimeException )
+{
+ rOut= L"a little string";
+}
+void SAL_CALL OComponent::testout_methodChar(sal_Unicode& rOut) throw( RuntimeException )
+{
+ rOut= 'A';
+}
+void SAL_CALL OComponent::testout_methodAny(Any& rOut) throw( RuntimeException)
+{
+ rOut <<= OUString(L"I am a string in an any");
+}
+void SAL_CALL OComponent::testout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException)
+{
+ rOut.realloc(10);
+ for( sal_Int16 i= 0; i < rOut.getLength(); i++) rOut.getArray()[i]= i;
+}
+void SAL_CALL OComponent::testout_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException )
+{
+ rOut.realloc( 10);
+ for( sal_Int16 i= 0; i < rOut.getLength(); i++){
+ Sequence<sal_Int32>& rseq2= rOut.getArray()[i];
+ rseq2.realloc( 10);
+ for (sal_Int16 j= 0; j < rseq2.getLength(); j++){
+ rseq2.getArray()[j]= j;
+ }
+ }
+}
+void SAL_CALL OComponent::testout_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException )
+{
+ rout1= 999;
+ rout2= 1111;
+}
+void SAL_CALL OComponent::testout_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException )
+{
+ rout1= 1111;
+ rout2= 1222;
+ rout3= L" another string";
+}
+void SAL_CALL OComponent::testout_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException )
+{
+ sout= L"Out Hallo!";
+}
+void SAL_CALL OComponent::testout_methodMulParams4( float in1, float& out1, sal_Int32 in2, sal_Int32& out2, sal_Int32 in3 ) throw(RuntimeException)
+{
+ out1= in1 + 1;
+ out2= in2 + 1;
+}
+
+void SAL_CALL OComponent::testout_methodXInterface( Reference< XInterface >& rOut ) throw(RuntimeException)
+{
+ OUString string( L"Property Any");
+ m_any <<= string;
+ rOut= (XInterface*) static_cast<XTestSequence*>(this);
+}
+
+// INOUT
+void SAL_CALL OComponent::testinout_methodByte(sal_Int8& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodFloat(float& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+
+void SAL_CALL OComponent::testinout_methodDouble(double& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodBool(sal_Bool& rOut) throw( RuntimeException )
+{
+ rOut= rOut== sal_True ? sal_False : sal_True;
+}
+void SAL_CALL OComponent::testinout_methodShort(sal_Int16& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodUShort(sal_uInt16& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodLong(sal_Int32& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodULong(sal_uInt32& rOut) throw( RuntimeException )
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodString(OUString& rOut) throw( RuntimeException )
+{
+ rOut= rOut + L" out string";
+}
+void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException)
+{
+ rOut += 1;
+}
+void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException)
+{
+ TypeClass t= rOut.getValueTypeClass();
+}
+void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException)
+{
+ for ( sal_Int32 i=0; i < rOut.getLength(); i++)
+ {
+ rOut.getArray()[i] += 1;
+ }
+}
+void SAL_CALL OComponent::testinout_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException )
+{
+ for( sal_Int32 i=0; i < rOut.getLength(); i++)
+ {
+ Sequence< sal_Int32 >& seq= rOut.getArray()[i];
+
+ for ( sal_Int32 j=0; j < seq.getLength(); j++)
+ {
+ seq.getArray()[j] += seq.getArray()[j];
+ }
+ }
+}
+
+// The parameter should implement XInvocation and a Property "value"
+void SAL_CALL OComponent::testinout_methodXInterface( Reference< XInvocation >& rOut ) throw(RuntimeException)
+{
+ Any any;
+ any= rOut->getValue( OUString( L"value"));
+ OUString _s;
+ any >>= _s;
+ OUString string(L" this string was written in the UNO component to the inout pararmeter");
+ any <<= string;
+ rOut->setValue( OUString(L"value"), any);
+}
+Any SAL_CALL OComponent::methodAnyTest1(const Any& rIn) throw( RuntimeException )
+{
+ return rIn;
+}
+Any SAL_CALL OComponent::getAttrAny2(void) throw( RuntimeException )
+{
+ return m_any;
+}
+void SAL_CALL OComponent::setAttrAny2(const Any& AttrAny2_) throw( RuntimeException )
+{
+ m_any= AttrAny2_;
+}
+
+
+
+// XTestStruct =======================================================================================
+
+void SAL_CALL OComponent::methodStruct(const Property& aProp) throw( RuntimeException )
+{
+}
+
+Property SAL_CALL OComponent::retMethodStruct(void) throw( RuntimeException )
+{
+ Property a(L"OleTest_Property", 255, getCppuType( (Reference<XInterface>*)0), PropertyAttribute::MAYBEVOID |
+ PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED |
+ PropertyAttribute::TRANSIENT | PropertyAttribute::READONLY |
+ PropertyAttribute::MAYBEAMBIGUOUS | PropertyAttribute::MAYBEDEFAULT );
+ return a;
+}
+
+Property SAL_CALL OComponent::getAttrStruct(void) throw( RuntimeException)
+{
+ Property a(L"OleTest_Property", 255, getCppuType( (Reference<XInterface>*)0), PropertyAttribute::MAYBEVOID |
+ PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED |
+ PropertyAttribute::TRANSIENT | PropertyAttribute::READONLY |
+ PropertyAttribute::MAYBEAMBIGUOUS | PropertyAttribute::MAYBEDEFAULT );
+ return a;
+
+}
+
+void SAL_CALL OComponent::setAttrStruct(const Property& AttrStruct_) throw( RuntimeException )
+{}
+
+// XTestOther ==================================================================================
+void SAL_CALL OComponent::other_methodAnyIn(const Any& rAny) throw( RuntimeException )
+{
+}
+void SAL_CALL OComponent::other_methodAnyOut(Any& rAny) throw( RuntimeException )
+{
+ rAny <<= OUString(L"Ein Any");
+}
+
+Any SAL_CALL OComponent::other_methodAnyRet(void) throw(RuntimeException )
+{
+ Any a;
+ a <<= OUString(L"Ein Any");
+ return a;
+}
+void SAL_CALL OComponent::in_float( float val) throw ( RuntimeException)
+{
+ char buff[256];
+ sprintf( buff, "parameter : %f", val);
+ MessageBox( NULL, _T(buff), _T("OleTest"), MB_OK);
+}
+
+// XTestOutParameters ============================================================================
+void SAL_CALL OComponent::out_test(sal_Int8 rIn) throw( RuntimeException )
+{
+}
+
+void SAL_CALL OComponent::out_methodByte(sal_Int8& rOut) throw( RuntimeException )
+{
+ rOut= 100;
+}
+void SAL_CALL OComponent::out_methodDouble(double& rOut) throw( RuntimeException )
+{
+ rOut= 3.14;
+}
+void SAL_CALL OComponent::out_methodFloat(float& rOut) throw( RuntimeException )
+{
+ rOut= 3.14;
+}
+void SAL_CALL OComponent::out_methodBool(sal_Bool& rOut) throw( RuntimeException )
+{
+ rOut= sal_True;
+}
+void SAL_CALL OComponent::out_methodShort(sal_Int16& rOut) throw( RuntimeException )
+{
+ rOut= -100;
+}
+void SAL_CALL OComponent::out_methodUShort(sal_uInt16& rOut) throw( RuntimeException )
+{
+ rOut= 100;
+}
+void SAL_CALL OComponent::out_methodLong(sal_Int32& rOut) throw( RuntimeException )
+{
+ rOut= -100;
+}
+
+void SAL_CALL OComponent::out_methodULong(sal_uInt32& rOut) throw( RuntimeException )
+{
+ rOut= 100;
+}
+void SAL_CALL OComponent::out_methodString(OUString& rOut) throw( RuntimeException )
+{
+ rOut= L"I'm a string";
+}
+void SAL_CALL OComponent::out_methodChar(sal_Unicode& rOut) throw( RuntimeException )
+{
+ rOut= 'A';
+}
+void SAL_CALL OComponent::out_methodAny(Any& rOut) throw( RuntimeException)
+{
+ Any a;
+ a <<= OUString( L"Hi");
+ rOut= a;
+}
+void SAL_CALL OComponent::out_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException )
+{
+ Sequence< sal_Int32 > aseq(10);
+ for( sal_Int16 i= 0; i < aseq.getLength(); i++) aseq.getArray()[i]= i;
+ rOut= aseq;
+}
+void SAL_CALL OComponent::out_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException )
+{
+ rOut= Sequence< Sequence< sal_Int32 > >();
+}
+void SAL_CALL OComponent::out_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException )
+{
+ rout1= 111;
+ rout2= 222;
+}
+void SAL_CALL OComponent::out_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException )
+{
+ rout1= 111;
+ rout2= 222;
+ rout3= L"this is a neet little string";
+}
+void SAL_CALL OComponent::out_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException )
+{
+ sout= L"this is a neet little string";
+}
+
+// XTestInterfaces -------------------------------------------------------------------------------------
+void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallback, sal_Int32 mode ) throw(RuntimeException)
+{
+ USES_CONVERSION;
+ sal_Int32 i=0;
+ OUString aString;
+ char buff[1024];
+
+ Reference<XSimple> xSimple;
+ SimpleStruct aSimpleStruct;
+ SimpleEnum aSimpleEnum;
+ Sequence<Any> seqAny;
+ Sequence< sal_Int8 > seqByte;
+ Any outAny;
+ sal_Bool aBool;
+ sal_Unicode aChar;
+ float aFloat;
+ double aDouble;
+ sal_Int8 aByte;
+ sal_Int16 aShort;
+ sal_Int32 aLong;
+ sal_uInt16 aUShort;
+ sal_uInt32 aULong;
+
+ switch( mode)
+ {
+ case 1:
+ xCallback->func1(); break;
+ case 2:
+ xSimple= xCallback->returnInterface();
+ xSimple->func(L"XCallback::returnInterface");
+ break;
+
+
+ case 3:
+ xCallback->outInterface( xSimple);
+ sprintf( buff, "XCallback::outInterface, value: %x", xSimple.get());
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ xSimple->func(L"XCallback::outInterface works");
+ break;
+ case 4:
+ xCallback->outStruct( aSimpleStruct);
+ sprintf( buff,"XCallback::outStruct, SimpleStruct::message: %s", OLE2A( aSimpleStruct.message));
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 5:
+ xCallback->outEnum( aSimpleEnum);
+ sprintf( buff,"XCallback::outEnum, SimpleEnum: %d", aSimpleEnum);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 6:
+ xCallback->outSeqAny( seqAny);
+ sprintf( buff,"XCallback::outSeqAny, length: %d )", seqAny.getLength());
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ for( i=0; i < seqAny.getLength(); i++)
+ {
+ Any any= seqAny[i];
+ if( any.getValueTypeClass() == TypeClass_STRING)
+ {
+ any >>= aString;
+ OutputDebugStringW( aString);
+ }
+
+ }
+ break;
+ case 7:
+ xCallback->outAny( outAny);
+ if( outAny.getValueTypeClass() == TypeClass_STRING)
+ outAny >>= aString;
+ sprintf( buff,"XCallback::outAny, Any : %s", W2A( aString));
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 8:
+ xCallback->outBool( aBool);
+ sprintf( buff,"XCallback::outBool, value: %d", aBool);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 9:
+ xCallback->outChar( aChar);
+ sprintf( buff,"XCallback::outChar, value: %C", aChar);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 10:
+ xCallback->outString( aString);
+ sprintf( buff,"XCallback::outString, value: %s", W2A( aString));
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 11:
+ xCallback->outFloat( aFloat);
+ sprintf( buff,"XCallback::outFloat, value: %f", aFloat);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 12:
+ xCallback->outDouble( aDouble);
+ sprintf( buff,"XCallback::outDouble, value: %f", aDouble);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 13:
+ xCallback->outByte( aByte);
+ sprintf( buff,"XCallback::outByte, value: %d", aByte);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 14:
+ xCallback->outShort( aShort);
+ sprintf( buff,"XCallback::outShort, value: %d", aShort);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 15:
+ xCallback->outLong( aLong);
+ sprintf( buff,"XCallback::outLong, value: %d", aLong);
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ break;
+ case 18:
+ case 19:
+ case 30:
+ {
+
+ long outLong= 0;
+ xCallback->outValuesMixed( 1111, outLong, OUString( L"in string") );
+
+ sprintf( buff, "oletest.testInterface: outValue: %d", outLong);
+ MessageBox( NULL, A2T(buff), _T("OleTest"), MB_OK);
+ break;
+ }
+
+ case 31:
+ {
+ Reference< XSimple > xSimple;
+ SimpleStruct aSimpleStruct;
+ SimpleEnum aSimpleEnum;
+ Sequence<Any> seqAny;
+ Any aAny;
+ sal_Bool aBool;
+ sal_Unicode aChar;
+ OUString aString;
+ float aFloat;
+ double aDouble;
+ sal_Int8 aByte;
+ sal_Int16 aShort;
+ sal_Int32 aLong;
+ sal_uInt16 aUShort;
+ sal_uInt32 aULong;
+ xCallback->outValuesAll( xSimple, aSimpleStruct, aSimpleEnum, seqAny, aAny, aBool,
+ aChar, aString,
+ aFloat, aDouble,
+ aByte,
+ aShort, aLong);
+
+ MessageBox( NULL, _T("XCallback::outValuesAll returned"), _T("OleTest::testInterface"), MB_OK);
+ break;
+ }
+ case 32:
+ {
+
+ xCallback->outSeqByte( seqByte);
+ sprintf( buff,"XCallback::outSeqAny, length: %d )", seqAny.getLength());
+ MessageBox( NULL, A2T(buff), _T("OleTest out parameter"), MB_OK);
+ for( i=0; i < seqAny.getLength(); i++)
+ {
+ Any any= seqAny[i];
+ if( any.getValueTypeClass() == TypeClass_STRING)
+ {
+ any >>= aString;
+ OutputDebugStringW( aString);
+ }
+ }
+ break;
+ }
+ // ############################################################################
+ // IN OUT parameter
+ // ############################################################################
+ case 100:
+ {
+ Reference<XSimple> xSimple= static_cast<XSimple*>(this);
+ xCallback->inoutInterface( xSimple);
+ xSimple->func(L"XSimple called from OleTest");
+ break;
+ }
+ case 101:
+ {
+ Reference<XIdlReflection> xRefl( m_rFactory->createInstance(L"com.sun.star.reflection.CoreReflection"), UNO_QUERY);
+ if( xRefl.is())
+ {
+ Reference<XIdlClass> xClass= xRefl->forName(L"oletest.SimpleStruct");
+ Any any;
+ if( xClass.is())
+ xClass->createObject( any);
+
+ if( any.getValueTypeClass() == TypeClass_STRUCT)
+ {
+ SimpleStruct* pStruct= ( SimpleStruct*) any.getValue();
+ pStruct->message= OUString::createFromAscii("This struct was created in OleTest");
+
+ SimpleStruct aStruct;
+ any >>= aStruct;
+ xCallback->inoutStruct( aStruct);
+ // a Struct should now contain a different message
+ MessageBox( NULL, W2T(aStruct.message), _T("OleTest in out parameter"), MB_OK);
+ }
+
+ }
+ break;
+ }
+ case 102:
+ {
+ SimpleEnum aEnum= SimpleEnum_B;
+ xCallback->inoutEnum( aEnum);
+ char buff[1024];
+ sprintf( buff, "Enum: %d", aEnum);
+ MessageBox( NULL, A2T(buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 103:
+ {
+ Any arAny[3];
+ arAny[0] <<= OUString( L"string 0");
+ arAny[1] <<= OUString( L"string 1");
+ arAny[2] <<= OUString( L"string 2");
+
+ Sequence< Any >seqAny( arAny, 3);
+ xCallback->inoutSeqAny( seqAny);
+ char buff[1023];
+ sprintf( buff, "Sequence length: %d", seqAny.getLength());
+ MessageBox( NULL,A2T(buff) , _T("OleTest in out parameter"), MB_OK);
+
+ for( int i=0; i < seqAny.getLength(); i++)
+ {
+ Any any;
+ any <<= seqAny[i];
+ if(any.getValueTypeClass() == TypeClass_STRING)
+ {
+ OUString str;
+ any >>= str;
+
+ }
+ }
+
+ break;
+ }
+ case 104:
+ {
+ Any any;
+ OUString s(L" OleTest");
+ any <<= s;
+ xCallback->inoutAny(any);
+ if( any.getValueTypeClass() == TypeClass_STRING)
+ {
+ OUString s= *( rtl_uString**) any.getValue();
+ MessageBox( NULL, W2T( s), _T("OleTest: inout value any"), MB_OK);
+ }
+ break;
+ }
+ case 105:
+ {
+ sal_Bool b= sal_True;
+ xCallback->inoutBool( b);
+ char buff[1024];
+ sprintf( buff, "out value bool: %d", b);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 106:
+ {
+ sal_Unicode uc= L'A';
+ xCallback->inoutChar( uc);
+ char buff[1024];
+ sprintf( buff, "out value sal_Unicode: %C", uc);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 107:
+ {
+ OUString s(L"OleTest");
+ xCallback->inoutString( s);
+ char buff[1024];
+ sprintf( buff, "out value string: %S", s.getStr());
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 108:
+ {
+ float f= 3.14;
+ xCallback->inoutFloat(f);
+ char buff[1024];
+ sprintf( buff, "out value float: %f", f);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 109:
+ {
+ double f= 3.145;
+ xCallback->inoutDouble( f);
+ char buff[1024];
+ sprintf( buff, "out value double: %g", f);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 110:
+ {
+ sal_Int8 aByte= 0xf;
+ xCallback->inoutByte( aByte);
+ char buff[1024];
+ sprintf( buff, "out value sal_Int8: %d", aByte);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 111:
+ {
+ sal_Int16 aShort= 0xff;
+ xCallback->inoutShort( aShort);
+ char buff[1024];
+ sprintf( buff, "out value sal_Int16: %d", aShort);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 112:
+ {
+ sal_Int32 aLong= 0xfffe;
+ xCallback->inoutLong( aLong);
+ char buff[1024];
+ sprintf( buff, "out value sal_Int32: %d", aLong);
+ MessageBox( NULL, A2T( buff), _T("OleTest in out parameter"), MB_OK);
+ break;
+ }
+ case 120:
+ {
+ Reference<XSimple> aXSimple= static_cast<XSimple*>(this);
+
+ SimpleStruct aStruct;
+ Reference<XIdlReflection> xRefl( m_rFactory->createInstance(L"com.sun.star.reflection.CoreReflection"), UNO_QUERY);
+ if( xRefl.is())
+ {
+ Reference<XIdlClass> xClass= xRefl->forName(L"oletest.SimpleStruct");
+ Any any;
+ if( xClass.is())
+ xClass->createObject( any);
+
+ if( any.getValueTypeClass() == TypeClass_STRUCT)
+ {
+ SimpleStruct* pStruct= ( SimpleStruct*) any.getValue();
+ pStruct->message= OUString::createFromAscii("This struct was created in OleTest");
+ any >>= aStruct;
+ }
+ }
+
+ SimpleEnum aEnum= SimpleEnum_B;
+
+ Sequence< Any > aSeq;
+ Any arAny[3];
+ arAny[0] <<= OUString( L"string 0");
+ arAny[1] <<= OUString( L"string 1");
+ arAny[2] <<= OUString( L"string 2");
+ aSeq = Sequence< Any >( arAny, 3);
+
+ Any aAny;
+ OUString s(L" OleTest");
+ aAny <<= s;
+
+ sal_Bool aBool= sal_True;
+ sal_Unicode aChar= L'A';
+ OUString aString( L"OleTest");
+ float aFloat=3.14;
+ double aDouble= 3.145;
+ sal_Int8 aByte= 0xf;
+ sal_Int16 aShort= 0xff;
+ sal_Int32 aLong= 0xffe;
+
+ xCallback->inoutValuesAll( aXSimple, aStruct, aEnum, aSeq,
+ aAny, aBool, aChar, aString, aFloat, aDouble,
+ aByte, aShort, aLong );
+
+ aXSimple->func(L"XSimple called from OleTest");
+ MessageBox( NULL, W2T(aStruct.message), _T("OleTest"), MB_OK);
+
+ for( int i=0; i < aSeq.getLength(); i++)
+ {
+ Any any;
+ any <<= aSeq[i];
+ if(any.getValueTypeClass() == TypeClass_STRING)
+ {
+ OUString str;
+ any >>= str;
+
+ }
+ }
+ break;
+ }
+
+ // ############################################################################
+ // IN parameter
+ // ############################################################################
+
+ case 200:
+
+ xCallback->inValues( L'a', 0xffffL, OUString(L" a string from OleTest"));
+ break;
+ case 201:
+ {
+ sal_Int8 arbyte[3]= { 1,2,3};
+ Sequence< sal_Int8 > seq( arbyte, 3);
+ xCallback->inSeqByte( seq);
+ break;
+ }
+
+ // ############################################################################
+ // Call a COM object that has not been passed as parameter to a UNO component and
+ // hence no type information are available in the COM wrapper
+ // ############################################################################
+ case 300:
+ {
+ Reference<XInterface> xIntFact = m_rFactory->createInstance(L"com.sun.star.bridge.OleObjectFactory");
+
+ Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY);
+
+ Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback");
+ Reference<XInvocation> xInv( xIntCallback, UNO_QUERY);
+//Any SAL_CALL invoke( const OUString& aFunctionName, const Sequence<Any >& aParams,Sequence< sal_Int16 >& aOutParamIndex,
+// Sequence<Any >& aOutParam );
+ Sequence<sal_Int16> seqIndizes;
+ Sequence<Any> seqOutParams;
+ xInv->invoke( OUString( L"outValuesAll"), Sequence<Any>(), seqIndizes, seqOutParams);
+
+// void outValuesAll( [out] oletest::XSimple outInterface,
+// [out] SimpleStruct outStruct ,
+// [out] SimpleEnum outEnum,
+// [out] sequence<any> outSeqAny,
+// [out] any outAny,
+// [out] boolean outBool,
+// [out] char outChar,
+// [out] string outString,
+// [out] float outFloat,
+// [out] double outDouble,
+// [out] byte outByte,
+// [out] short outShort,
+// [out] long outLong);
+ if( seqOutParams.getLength() == 12)
+ {
+ Reference<XSimple> xSimple= *(XSimple**)seqOutParams[0].getValue();
+ xSimple->func( L"Call from OleTest on XSimple");
+ SimpleStruct aStruct;
+ seqOutParams[1] >>= aStruct;
+ SimpleEnum aEnum= *(SimpleEnum*)seqOutParams[2].getValue();
+
+ Sequence<Any> seqAny;
+ seqOutParams[3] >>= seqAny;
+ for( int i=0; i<seqAny.getLength(); i++)
+ {
+ OUString _s;
+ seqAny[i] >>= _s;
+ }
+
+ Any _any= *(Any*)seqOutParams[4].getValue();
+ sal_Bool _bool= *(sal_Bool*)seqOutParams[5].getValue();
+ sal_Unicode _char= *( sal_Unicode*) seqOutParams[6].getValue();
+ OUString _str= *( rtl_uString**)seqOutParams[7].getValue();
+
+ float _f= *( float*)seqOutParams[8].getValue();
+ double _d= *( double*) seqOutParams[9].getValue();
+ sal_Int8 _byte= *( sal_Int8*) seqOutParams[10].getValue();
+ sal_Int16 _short= *( sal_Int16*) seqOutParams[11].getValue();
+
+ sal_Int32 _long= *( sal_Int32*) seqOutParams[12].getValue();
+
+ }
+ break;
+ }
+ case 301:
+ // in / out parameter
+ {
+ Reference<XInterface> xIntFact = m_rFactory->createInstance(L"com.sun.star.bridge.OleObjectFactory");
+
+ Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY);
+
+ Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback");
+ Reference<XInvocation> xInv( xIntCallback, UNO_QUERY);
+ Sequence<sal_Int16> seqIndizes;
+ Sequence<Any> seqOutParams;
+
+
+ Any arAny[13];
+ Reference<XSimple> xSimple= static_cast<XSimple*>( this);
+
+ arAny[0] <<= xSimple;
+ SimpleStruct aStruct;
+ Reference<XIdlReflection> xRefl( m_rFactory->createInstance(L"com.sun.star.reflection.CoreReflection"), UNO_QUERY);
+ if( xRefl.is())
+ {
+ Reference<XIdlClass> xClass= xRefl->forName(L"oletest.SimpleStruct");
+ Any any;
+ if( xClass.is())
+ xClass->createObject( any);
+
+ if( any.getValueTypeClass() == TypeClass_STRUCT)
+ {
+ SimpleStruct* pStruct= ( SimpleStruct*) any.getValue();
+ pStruct->message= OUString::createFromAscii("This struct was created in OleTest");
+ any >>= aStruct;
+ }
+ }
+ arAny[1] <<= aStruct;
+ arAny[2] <<= SimpleEnum_C;
+
+ Any arSeqAny[3];
+ arSeqAny[0] <<= OUString( L"string 0");
+ arSeqAny[1] <<= OUString( L"string 1");
+ arSeqAny[2] <<= OUString( L"string 2");
+
+ arAny[3] <<= Sequence< Any >( arAny, 3);
+
+ OUString str(L" Ein Any param");
+ arAny[4] <<= str;
+ arAny[5] <<= sal_False;
+ arAny[6] <<= L'B';
+ OUString stringParam(L" a string parameter");
+ arAny[7] <<= stringParam;
+ float _float= 3.14;
+ arAny[8] <<= _float;
+ double _double= 3.145;
+ arAny[9] <<= _double;
+ sal_Int8 _byte= 0xff;
+ arAny[10] <<= _byte;
+ sal_Int16 _short= 0xffff;
+ arAny[11] <<= _short;
+ sal_Int32 _long= 0xffffffff;
+ arAny[12] <<= _long;
+//
+ Sequence<Any> params( arAny, 13);
+
+ xInv->invoke( OUString( L"inoutValuesAll"), params, seqIndizes, seqOutParams);
+
+ if( seqOutParams.getLength() == 12)
+ {
+ Reference<XSimple> xSimple= *(XSimple**)seqOutParams[0].getValue();
+ xSimple->func( L"Call from OleTest on XSimple");
+ SimpleStruct aStruct;
+ seqOutParams[1] >>= aStruct;
+ SimpleEnum aEnum= *(SimpleEnum*)seqOutParams[2].getValue();
+
+ Sequence<Any> seqAny;
+ seqOutParams[3] >>= seqAny;
+ for( int i=0; i<seqAny.getLength(); i++)
+ {
+ OUString _s;
+ seqAny[i] >>= _s;
+ }
+
+ Any _any= *(Any*)seqOutParams[4].getValue();
+ sal_Bool _bool= *(sal_Bool*)seqOutParams[5].getValue();
+ sal_Unicode _char= *( sal_Unicode*) seqOutParams[6].getValue();
+ OUString _str= *( rtl_uString**)seqOutParams[7].getValue();
+
+ float _f= *( float*)seqOutParams[8].getValue();
+ double _d= *( double*) seqOutParams[9].getValue();
+ sal_Int8 _byte= *( sal_Int8*) seqOutParams[10].getValue();
+ sal_Int16 _short= *( sal_Int16*) seqOutParams[11].getValue();
+
+ sal_Int32 _long= *( sal_Int32*) seqOutParams[12].getValue();
+
+ }
+ break;
+ }
+ case 303:
+ // in parameter
+// void inValues( [in] char aChar, [in] long aLong, [in] string aString);
+ {
+ Reference<XInterface> xIntFact = m_rFactory->createInstance(L"com.sun.star.bridge.OleObjectFactory");
+
+ Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY);
+
+ Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback");
+ Reference<XInvocation> xInv( xIntCallback, UNO_QUERY);
+ Sequence<sal_Int16> seqIndizes;
+ Sequence<Any> seqOutParams;
+
+ Any arAny[3];
+ sal_Unicode aChar=L'a';
+ arAny[0] <<= aChar;
+ sal_Int32 aLong= 0xffffffff;
+ arAny[1] <<= aLong;
+ OUString aString(L" a string parameter");
+ arAny[2] <<= aString;
+
+ xInv->invoke( OUString( L"inValues"), Sequence<Any>(arAny,3), seqIndizes, seqOutParams);
+
+ break;
+ }
+
+
+
+
+ }
+
+}
+
+// XSimple --------------------------------------------------------------------------
+void SAL_CALL OComponent::func( const OUString &message)throw(::com::sun::star::uno::RuntimeException)
+{
+ USES_CONVERSION;
+
+ MessageBox( NULL, W2T( message.getStr()), _T("OleTest: XSimple::func"), MB_OK);
+}
+// XSimple --------------------------------------------------------------------------
+OUString SAL_CALL OComponent::getName()throw(::com::sun::star::uno::RuntimeException)
+{
+ return L"XSimple";
+}
+void SAL_CALL OComponent::testInterface2( const Reference< XSimple >& xSimple, sal_Int32 mode ) throw(RuntimeException)
+{
+ switch( mode)
+ {
+ case 0:
+ {
+ xSimple->func( L"OleTest is calling XSimple");
+ Reference<XSimple2> xSimple2( xSimple, UNO_QUERY);
+ if( xSimple2.is())
+ xSimple2->func2( L"OleTest is calling XSimple2");
+ Reference<XSimple3> xSimple3( xSimple, UNO_QUERY);
+ if( xSimple3.is())
+ xSimple3->func3( L"OleTest is calling XSimple3");
+
+ break;
+ }
+ }
+}
diff --git a/extensions/test/ole/cpnt/exports.dxp b/extensions/test/ole/cpnt/exports.dxp
new file mode 100644
index 000000000000..a265aeec0b7f
--- /dev/null
+++ b/extensions/test/ole/cpnt/exports.dxp
@@ -0,0 +1,3 @@
+component_writeInfo
+component_getFactory
+component_getImplementationEnvironment \ No newline at end of file
diff --git a/extensions/test/ole/cpnt/makefile.mk b/extensions/test/ole/cpnt/makefile.mk
new file mode 100644
index 000000000000..b53519118f71
--- /dev/null
+++ b/extensions/test/ole/cpnt/makefile.mk
@@ -0,0 +1,146 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+PRJ=..$/..$/..
+
+PRJNAME= extensions
+TARGET= oletest
+#LIBTARGET= NO
+#TARGETTYPE= CUI
+ENABLE_EXCEPTIONS=TRUE
+NO_BSYMBOLIC= TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES= \
+ $(SLO)$/cpnt.obj
+
+UNOUCRDEP= $(SOLARBINDIR)$/applicat.rdb $(BIN)$/oletest.rdb
+UNOUCRRDB= $(SOLARBINDIR)$/applicat.rdb $(BIN)$/oletest.rdb
+
+UNOUCROUT= $(OUT)$/inc
+INCPRE+= $(OUT)$/inc -I$(SOLARINCDIR)$/external$/atl
+#INCPRE+= -I$(SOLARINCDIR)$/external$/atl
+LIBCMT=msvcrtd.lib
+
+UNOTYPES= oletest.XTestSequence oletest.XTestStruct \
+ oletest.XTestOther \
+ oletest.XTestInterfaces \
+ oletest.XSimple \
+ oletest.XSimple2 \
+ oletest.XSimple3 \
+ com.sun.star.beans.PropertyAttribute \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.registry.XRegistryKey \
+ com.sun.star.script.XInvocation \
+ com.sun.star.reflection.XIdlReflection
+
+
+SHL1TARGET= $(TARGET)
+
+SHL1STDLIBS= \
+ $(SALLIB) \
+ $(VOSLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB)
+
+SHL1DEPN=
+SHL1IMPLIB= i$(TARGET)
+SHL1LIBS= $(SLB)$/$(TARGET).lib
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME= $(SHL1TARGET)
+DEF1EXPORTFILE= exports.dxp
+
+
+ALLIDLFILES:= ..$/idl$/oletest.idl
+
+# --- Targets ------------------------------------------------------
+
+.IF "$(depend)" == ""
+ALL : $(BIN)$/oletest.rdb \
+ ALLTAR
+
+.ELSE
+ALL: ALLDEP
+.ENDIF
+
+.INCLUDE : target.mk
+
+
+
+$(BIN)$/oletest.rdb: $(ALLIDLFILES)
+ +unoidl -I$(PRJ) -I$(SOLARIDLDIR) -Burd -OH$(BIN) $?
+ +regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)}
+ touch $@
+
+#unoheader: $(BIN)$/testcppu.rdb
+# +cppumaker -BUCR $(CPPUMAKERFLAGS) -O$(UNOUCROUT) $(TYPES) $(BIN)$/testcppu.rdb
+
diff --git a/extensions/test/ole/cpnt/readme.txt b/extensions/test/ole/cpnt/readme.txt
new file mode 100644
index 000000000000..62a12a1ef250
--- /dev/null
+++ b/extensions/test/ole/cpnt/readme.txt
@@ -0,0 +1,5 @@
+cpnt.cxx contains a uno component that is uses to test the olebridge
+within a JavaScript context.
+In particular it has functions using out, in/out and sequence parameter
+that have to be specifically treated in JScript because they are represented
+by IDispatch objects. \ No newline at end of file
diff --git a/extensions/test/ole/cpptest/StdAfx.cpp b/extensions/test/ole/cpptest/StdAfx.cpp
new file mode 100644
index 000000000000..2f8b97dd7b61
--- /dev/null
+++ b/extensions/test/ole/cpptest/StdAfx.cpp
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.cpp : source file that includes just the standard includes
+// cpptest.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/extensions/test/ole/cpptest/StdAfx.h b/extensions/test/ole/cpptest/StdAfx.h
new file mode 100644
index 000000000000..a838fba37c4f
--- /dev/null
+++ b/extensions/test/ole/cpptest/StdAfx.h
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__84C60723_E38E_11D3_82FC_005004526AB4__INCLUDED_)
+#define AFX_STDAFX_H__84C60723_E38E_11D3_82FC_005004526AB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+#include <comdef.h>
+#include <tchar.h>
+#include<atlbase.h>
+extern CComModule _Module;
+#include<atlcom.h>
+#include<atlimpl.cpp>
+
+
+// TODO: reference additional headers your program requires here
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__84C60723_E38E_11D3_82FC_005004526AB4__INCLUDED_)
diff --git a/extensions/test/ole/cpptest/cpptest.cpp b/extensions/test/ole/cpptest/cpptest.cpp
new file mode 100644
index 000000000000..135e0188af02
--- /dev/null
+++ b/extensions/test/ole/cpptest/cpptest.cpp
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: cpptest.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// cpptest.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+CComModule _Module;
+BEGIN_OBJECT_MAP(ObjectMap)
+END_OBJECT_MAP()
+
+
+HRESULT doTest();
+
+int main(int argc, char* argv[])
+{
+ HRESULT hr;
+ if( FAILED( hr=CoInitialize(NULL)))
+ {
+ _tprintf(_T("CoInitialize failed \n"));
+ return -1;
+ }
+
+
+ _Module.Init( ObjectMap, GetModuleHandle( NULL));
+
+ if( FAILED(hr=doTest()))
+ {
+ _com_error err( hr);
+ const TCHAR * errMsg= err.ErrorMessage();
+ MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
+ }
+
+
+ _Module.Term();
+ CoUninitialize();
+ return 0;
+}
+
+HRESULT doTest()
+{
+ HRESULT hr;
+ CComPtr<IUnknown> spUnkMgr;
+
+
+// GUID idOffice= {0x3ECF78F0,0xB149,0x11D2,{0x8E,0xBE,0x00,0x10,0x5A,0xD8,0x48,0xAF}};
+// IUnknown * pUnk;
+// hr= CoCreateInstance( idOffice, NULL, CLSCTX_ALL, __uuidof(IUnknown), (void**) &pUnk);
+
+ if( FAILED(hr= spUnkMgr.CoCreateInstance(L"stardiv.uno.ServiceManager")))
+ return hr;
+
+ return S_OK;
+
+}
diff --git a/extensions/test/ole/cpptest/cpptest.dsp b/extensions/test/ole/cpptest/cpptest.dsp
new file mode 100644
index 000000000000..4e06418501cf
--- /dev/null
+++ b/extensions/test/ole/cpptest/cpptest.dsp
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="cpptest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=cpptest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "cpptest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "cpptest.mak" CFG="cpptest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "cpptest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "cpptest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "cpptest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "cpptest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "cpptest - Win32 Release"
+# Name "cpptest - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\cpptest.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
diff --git a/extensions/test/ole/cpptest/cpptest.dsw b/extensions/test/ole/cpptest/cpptest.dsw
new file mode 100644
index 000000000000..0cea1c2d0cee
--- /dev/null
+++ b/extensions/test/ole/cpptest/cpptest.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "cpptest"=.\cpptest.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/extensions/test/ole/idl/oletest.idl b/extensions/test/ole/idl/oletest.idl
new file mode 100644
index 000000000000..af7562200bc6
--- /dev/null
+++ b/extensions/test/ole/idl/oletest.idl
@@ -0,0 +1,309 @@
+/*************************************************************************
+ *
+ * $RCSfile: oletest.idl,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+//#include <stardiv/uno/interface.idl>
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/script/XInvocation.idl>
+//#include <stardiv/uno/beans/propset.idl>
+#include <com/sun/star/beans/XPropertySet.idl>
+
+/*=============================================================================
+
+ $Source: /cvs/Archiv/one/stardiv/one/chart/xcenum.idl,v 1.6 1999/04/26 10:42
+
+ status: proofreading done
+
+ (c) Copyright 1998-1999, Star Office Entwicklungs GmbH, Hamburg
+
+=============================================================================*/
+
+module oletest
+{
+
+[ uik(8DE309C0-8310-11d3-9EEC0050-04526AB4), ident("XTestSequence", 1.0) ]
+interface XTestSequence: com::sun::star::uno::XInterface
+{
+ sequence<byte> methodByte( [in] sequence<byte> aSeq );
+ sequence<float> methodFloat( [in] sequence<float> aSeq);
+ sequence<double> methodDouble( [in] sequence<double> aSeq);
+ sequence<boolean> methodBool( [in] sequence<boolean> aSeq);
+ sequence<short> methodShort( [in] sequence<short> aSeq);
+ sequence<unsigned short> methodUShort( [in] sequence<unsigned short> aSeq);
+ sequence<long> methodLong( [in] sequence<long> aSeq);
+ sequence<unsigned long> methodULong( [in] sequence<unsigned long> aSeq);
+ sequence<string> methodString( [in] sequence<string> aSeq);
+ sequence<char> methodChar( [in] sequence<char> aSeq);
+ sequence<any> methodAny ( [in] sequence<any> aSeq);
+ sequence<com::sun::star::uno::XInterface> methodXInterface ( [in] sequence<com::sun::star::uno::XInterface> aSeq);
+ sequence< sequence <long> > methodSequence( [in] sequence< sequence< long > > aSeq);
+ sequence< sequence <sequence <long> > > methodSequence2( [in] sequence< sequence< sequence<long> > > aSeq);
+
+ [attribute] sequence<byte> AttrByte;
+ [attribute] sequence<float> AttrFloat;
+ [attribute] sequence<double> AttrDouble;
+ [attribute] sequence<boolean> AttrBool;
+ [attribute] sequence<short> AttrShort;
+ [attribute] sequence<unsigned short> AttrUShort;
+ [attribute] sequence<long> AttrLong;
+ [attribute] sequence<unsigned long> AttrULong;
+ [attribute] sequence<string> AttrString;
+ [attribute] sequence<char> AttrChar;
+ [attribute] sequence<any> AttrAny;
+ [attribute] sequence< sequence<long> > AttrSequence;
+ [attribute] sequence< sequence< sequence <long> > > AttrSequence2;
+ [attribute] sequence< com::sun::star::uno::XInterface > AttrXInterface;
+
+ void testout_methodByte( [out] byte rOut );
+ void testout_methodFloat( [out] float rOut);
+ void testout_methodDouble( [out] double rOut);
+ void testout_methodBool( [out] boolean rOut);
+ void testout_methodShort( [out] short rOut);
+ void testout_methodUShort( [out] unsigned short rOut);
+ void testout_methodLong( [out] long rOut);
+ void testout_methodULong( [out] unsigned long rOut);
+ void testout_methodString( [out] string rOut);
+ void testout_methodChar( [out] char rOut);
+ void testout_methodAny ( [out] any rOut);
+ void testout_methodSequence( [out] sequence< long > rOut);
+ void testout_methodSequence2( [out] sequence < sequence< long > > rOut);
+ void testout_methodXInterface( [out] com::sun::star::uno::XInterface rOut);
+
+ void testout_methodMulParams1( [out] long rout1, [out] long rout2);
+ void testout_methodMulParams2( [out] long rout1, [out] long rout2, [out] string rout3);
+ void testout_methodMulParams3( [in] string sin, [out] string sout);
+ void testout_methodMulParams4( [in] float in1, [out] float out1, [in] long in2, [out] long out2, [in] long in3);
+
+ void testinout_methodByte( [inout] byte rOut );
+ void testinout_methodFloat( [inout] float rOut);
+ void testinout_methodDouble( [inout] double rOut);
+ void testinout_methodBool( [inout] boolean rOut);
+ void testinout_methodShort( [inout] short rOut);
+ void testinout_methodUShort( [inout] unsigned short rOut);
+ void testinout_methodLong( [inout] long rOut);
+ void testinout_methodULong( [inout] unsigned long rOut);
+ void testinout_methodString( [inout] string rOut);
+ void testinout_methodChar( [inout] char rOut);
+ void testinout_methodAny ( [inout] any rOut);
+ void testinout_methodSequence( [inout] sequence< long > rOut);
+ void testinout_methodSequence2( [inout] sequence < sequence< long > > rOut);
+ void testinout_methodXInterface( [inout] com::sun::star::script::XInvocation rOut);
+
+ any methodAnyTest1( [in] any rIn);
+ [attribute] any AttrAny2;
+
+};
+[uik(EBEF02B0-8C41-11d3-9EF90050-04526AB4), ident("XTestStruct", 1.0)]
+interface XTestStruct: com::sun::star::uno::XInterface
+{
+// Method taking structs as arguments
+ void methodStruct( [in] com::sun::star::beans::Property aProp);
+// Methods returning structs
+ com::sun::star::beans::Property retMethodStruct();
+// Attributes as structs
+ [attribute] com::sun::star::beans::Property AttrStruct;
+};
+
+[uik(E5087290-95E9-11d3-9F070050-04526AB4), ident("XTestOutParameters", 1.0)]
+interface XTestOutParameters: com::sun::star::uno::XInterface
+{
+ void out_methodByte( [out] byte rOut );
+ void out_methodDouble( [out] double rOut);
+ void out_methodBool( [out] boolean rOut);
+ void out_methodShort( [out] short rOut);
+ void out_methodUShort( [out] unsigned short rOut);
+ void out_methodLong( [out] long rOut);
+ void out_methodULong( [out] unsigned long rOut);
+ void out_methodString( [out] string rOut);
+ void out_methodChar( [out] char rOut);
+ void out_methodAny ( [out] any rOut);
+ void out_methodSequence( [out] sequence< long > rOut);
+ void out_methodSequence2( [out] sequence < sequence< long > > rOut);
+
+ void out_methodMulParams1( [out] long rout1, [out] long rout2);
+ void out_methodMulParams2( [out] long rout1, [out] long rout2, [out] string rout3);
+ void out_methodMulParams3( [in] string sin, [out] string sout);
+
+
+};
+
+struct SimpleStruct
+{
+ string message;
+};
+
+enum SimpleEnum
+{
+ A,
+ B,
+ C
+};
+
+[uik(57F9DDE0-9293-11d3-9F000050-04526AB4), ident("XTestOthers", 1.0)]
+interface XTestOther: com::sun::star::uno::XInterface
+{
+ // Any test
+ void other_methodAnyIn( [in] any rAny);
+ void other_methodAnyOut( [out] any rAny);
+ any other_methodAnyRet();
+ void in_float( [in] float val);
+};
+
+
+[uik(67E59870-6EA4-11d4-832F0050-04526AB4), ident("XSimple", 1.0)]
+interface XSimple: com::sun::star::uno::XInterface
+{
+ void func( [in] string message);
+ string getName();
+};
+[uik(29828AB0-79A0-11d4-83330050-04526AB4), ident("XSimple2", 1.0)]
+interface XSimple2: com::sun::star::uno::XInterface
+{
+ void func2( [in] string message);
+ string getName2();
+};
+[uik(29828AB1-79A0-11d4-83330050-04526AB4), ident("XSimple3", 1.0)]
+interface XSimple3: com::sun::star::uno::XInterface
+{
+ void func3( [in] string message);
+ string getName3();
+};
+
+[uik(4405B9E0-6D39-11d4-832F0050-04526AB4), ident("XTestOthers", 1.0)]
+interface XCallback: com::sun::star::uno::XInterface
+{
+ void func1();
+ oletest::XSimple returnInterface();
+ void outInterface( [out] oletest::XSimple outInterface);
+ void outStruct( [out] oletest::SimpleStruct outStruct);
+ void outEnum( [out] oletest::SimpleEnum outEnum);
+ void outSeqAny( [out] sequence<any> outSeqAny);
+ void outSeqByte( [out] sequence<byte> outVal);
+ void outAny( [out] any outAny);
+ void outBool( [out] boolean outBool);
+ void outChar( [out] char outChar);
+ void outString( [out] string outString);
+ void outFloat( [out] float outFloat);
+ void outDouble( [out] double outDouble);
+ void outByte( [out] byte outByte);
+ void outShort( [out] short outShort);
+ void outLong( [out] long outLong);
+ void outValuesMixed( [in] long lval, [out] long outval, [in] string sval);
+ void outValuesAll( [out] oletest::XSimple outInterface,
+ [out] SimpleStruct outStruct ,
+ [out] SimpleEnum outEnum,
+ [out] sequence<any> outSeqAny,
+ [out] any outAny,
+ [out] boolean outBool,
+ [out] char outChar,
+ [out] string outString,
+ [out] float outFloat,
+ [out] double outDouble,
+ [out] byte outByte,
+ [out] short outShort,
+ [out] long outLong);
+// IN OUT parameters
+ void inoutInterface( [inout] oletest::XSimple inoutVal);
+ void inoutStruct( [inout] oletest::SimpleStruct inoutVal);
+ void inoutEnum( [inout] oletest::SimpleEnum inoutVal);
+ void inoutSeqAny( [inout] sequence<any> inoutVal);
+ void inoutAny( [inout] any inoutVal);
+ void inoutBool( [inout] boolean inoutVal);
+ void inoutChar( [inout] char inoutVal);
+ void inoutString( [inout] string inoutVal);
+ void inoutFloat( [inout] float inoutVal);
+ void inoutDouble( [inout] double inoutVal);
+ void inoutByte( [inout] byte inoutVal);
+ void inoutShort( [inout] short inoutVal);
+ void inoutLong( [inout] long inoutVal);
+
+ void inoutValuesAll( [inout] oletest::XSimple aXSimple,
+ [inout] oletest::SimpleStruct aStruct,
+ [inout] oletest::SimpleEnum aEnum,
+ [inout] sequence<any> aSeq,
+ [inout] any aAny,
+ [inout] boolean aBool,
+ [inout] char aChar,
+ [inout] string aString,
+ [inout] float aFloat,
+ [inout] double aDouble,
+ [inout] byte aByte,
+ [inout] short aShort,
+ [inout] long aLong);
+
+ // IN parameter
+
+ void inValues( [in] char aChar, [in] long aLong, [in] string aString);
+ void inSeqByte( [in] sequence<byte> val);
+
+
+
+};
+
+
+[uik(259159C0-6D38-11d4-832F0050-04526AB4), ident("XTestOthers", 1.0)]
+interface XTestInterfaces: com::sun::star::uno::XInterface
+{
+ // Any test
+ void testInterface( [in] oletest::XCallback xCallback, [in] long mode);
+ void testInterface2( [in] oletest::XSimple xSimple, [in] long mode);
+};
+
+}; // oletest
+
diff --git a/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp b/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp
new file mode 100644
index 000000000000..5001be709810
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.cpp : source file that includes just the standard includes
+// Test.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/extensions/test/ole/unoTocomCalls/Test/StdAfx.h b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h
new file mode 100644
index 000000000000..0e2b23c0f4d2
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__180FF568_6F5C_11D4_8330_005004526AB4__INCLUDED_)
+#define AFX_STDAFX_H__180FF568_6F5C_11D4_8330_005004526AB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+#include <stdio.h>
+#include <windows.h>
+#include <comdef.h>
+#include <tchar.h>
+#include <atlbase.h>
+extern CComModule _Module;
+#include<atlcom.h>
+#include<atlimpl.cpp>
+
+// TODO: reference additional headers your program requires here
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__180FF568_6F5C_11D4_8330_005004526AB4__INCLUDED_)
diff --git a/extensions/test/ole/unoTocomCalls/Test/Test.cpp b/extensions/test/ole/unoTocomCalls/Test/Test.cpp
new file mode 100644
index 000000000000..e7ec376cc460
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/Test/Test.cpp
@@ -0,0 +1,277 @@
+/*************************************************************************
+ *
+ * $RCSfile: Test.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Test.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "../XCallback_Impl/XCallback_Impl.h"
+#include "../XCallback_Impl/XCallback_Impl_i.c"
+
+CComModule _Module;
+BEGIN_OBJECT_MAP(ObjectMap)
+END_OBJECT_MAP()
+
+HRESULT doTest();
+
+int main(int argc, char* argv[])
+{
+ HRESULT hr;
+ if( FAILED( hr=CoInitialize(NULL)))
+ {
+ _tprintf(_T("CoInitialize failed \n"));
+ return -1;
+ }
+
+
+ _Module.Init( ObjectMap, GetModuleHandle( NULL));
+
+ if( FAILED(hr=doTest()))
+ {
+ _com_error err( hr);
+ const TCHAR * errMsg= err.ErrorMessage();
+ MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR);
+ }
+
+
+ _Module.Term();
+ CoUninitialize();
+
+
+ return 0;
+}
+
+
+HRESULT doTest()
+{
+ HRESULT hr= S_OK;
+
+ CComPtr<IUnknown> spUnk;
+ hr= spUnk.CoCreateInstance(L"com.sun.star.ServiceManager");
+ if( FAILED( hr))
+ return hr;
+
+ CComDispatchDriver manager( spUnk);
+ CComVariant param( L"oletest.OleTest");
+ CComVariant retVal;
+ hr= manager.Invoke1((LPCOLESTR)L"createInstance", &param, &retVal );
+
+ CComDispatchDriver oletest( retVal.punkVal);
+
+ spUnk.Release();
+
+ hr= spUnk.CoCreateInstance(L"XCallback_Impl.Callback");
+ if( FAILED( hr))
+ return hr;
+
+ CComQIPtr<IDispatch> paramDisp(spUnk);
+
+
+ //######################################################################
+ // out parameters
+ //######################################################################
+ CComVariant param1( paramDisp);
+ CComVariant param2(1);
+ // oletest calls XCallback::func1
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::returnInterface
+ param2= 2;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outInterface
+ param2= 3;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outStruct
+ param2= 4;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outEnum
+ param2= 5;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outSeqAny
+ param2= 6;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outAny
+ param2= 7;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outBool
+ param2= 8;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outChar
+ param2= 9;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outString
+ param2= 10;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outFloat
+ param2= 11;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outDouble
+ param2= 12;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outByte
+ param2= 13;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outShort
+ param2= 14;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outLong
+ param2= 15;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outValuesMixed
+ param2= 30;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::outValuesAll
+ param2= 31;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+
+ // XCallback::outSeqByte
+ // Does not work currently because Sequences are always converted to
+ // SAFEARRAY( VARIANT)
+ // param2= 32;
+ // hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+
+ //######################################################################
+ // in / out parameters
+ //######################################################################
+ // XCallback::inoutInterface
+ param2= 100;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutStruct
+ param2= 101;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutEnum
+ param2= 102;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutSeqAny
+ param2= 103;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutAny
+ param2= 104;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutBool
+ param2= 105;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutChar
+ param2= 106;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutString
+ param2= 107;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutFloat
+ param2= 108;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutDouble
+ param2= 109;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutByte
+ param2= 110;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutShort
+ param2= 111;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutLong
+ param2= 112;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutValuesAll
+ param2=120;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ //######################################################################
+ // in parameters
+ //######################################################################
+ // XCallback::inValues
+ param2= 200;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inSeqByte
+ // Does not work currently because Sequences are always converted to
+ // SAFEARRAY( VARIANT)
+ // param2= 201;
+ // hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+
+ //######################################################################
+ // The UNO test component OleTest calls on XCallback_Impl.Callback directly
+ // that is the COM object has not been past a parameter but rather OleTest
+ // creates the COM object itself
+ //######################################################################
+ // XCallback::outValuesAll
+ // does not work currently
+ param2= 300;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutValuesAll
+ param2= 301;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ // XCallback::inoutValues
+ param2= 302;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+
+ // XCallback::inValues
+ param2= 303;
+ hr= oletest.Invoke2(L"testInterface", &param1, &param2);
+ //######################################################################
+ // Test a COM object which implements several interfaces.
+ //######################################################################
+
+ CComQIPtr<IDispatch> dispSimple;
+ hr= dispSimple.CoCreateInstance(L"XCallback_Impl.Simple");
+ CComVariant varSimple( dispSimple);
+ param2= 0;
+ hr= oletest.Invoke2(L"testInterface2", &varSimple, &param2);
+
+ return hr;
+}
+// VARIANT CComVariant VT_UNKNOWN VT_DISPATCH V_UI1 CComDispatchDriver WINAPI
diff --git a/extensions/test/ole/unoTocomCalls/Test/Test.dsp b/extensions/test/ole/unoTocomCalls/Test/Test.dsp
new file mode 100644
index 000000000000..9572411e4b37
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/Test/Test.dsp
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="Test" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Test - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Test.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Test.mak" CFG="Test - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Test - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "Test - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "Test - Win32 Release"
+# Name "Test - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\Test.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Basic.rgs b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Basic.rgs
new file mode 100644
index 000000000000..39011d717a37
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Basic.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ XCallback_Impl.Basic.1 = s 'Basic Class'
+ {
+ CLSID = s '{A0F04CB7-8494-11D4-8335-005004526AB4}'
+ }
+ XCallback_Impl.Basic = s 'Basic Class'
+ {
+ CLSID = s '{A0F04CB7-8494-11D4-8335-005004526AB4}'
+ CurVer = s 'XCallback_Impl.Basic.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {A0F04CB7-8494-11D4-8335-005004526AB4} = s 'Basic Class'
+ {
+ ProgID = s 'XCallback_Impl.Basic.1'
+ VersionIndependentProgID = s 'XCallback_Impl.Basic'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{180FF553-6F5C-11D4-8330-005004526AB4}'
+ }
+ }
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/BasicTest.rgs b/extensions/test/ole/unoTocomCalls/XCallback_Impl/BasicTest.rgs
new file mode 100644
index 000000000000..e318d41eef84
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/BasicTest.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ XCallback_Impl.BasicTest.1 = s 'BasicTest Class'
+ {
+ CLSID = s '{A0F04CBD-8494-11D4-8335-005004526AB4}'
+ }
+ XCallback_Impl.BasicTest = s 'BasicTest Class'
+ {
+ CLSID = s '{A0F04CBD-8494-11D4-8335-005004526AB4}'
+ CurVer = s 'XCallback_Impl.BasicTest.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {A0F04CBD-8494-11D4-8335-005004526AB4} = s 'BasicTest Class'
+ {
+ ProgID = s 'XCallback_Impl.BasicTest.1'
+ VersionIndependentProgID = s 'XCallback_Impl.BasicTest'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{180FF553-6F5C-11D4-8330-005004526AB4}'
+ }
+ }
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp
new file mode 100644
index 000000000000..28cd6b56a737
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp
@@ -0,0 +1,517 @@
+/*************************************************************************
+ *
+ * $RCSfile: Callback.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Callback.cpp : Implementation of CCallback
+#include "stdafx.h"
+#include "XCallback_Impl.h"
+#include "Callback.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CCallback
+
+
+STDMETHODIMP CCallback::func1()
+{
+ MessageBox( NULL, _T("Callback::func1 called"),_T(""), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::returnInterface(IDispatch **ppdisp)
+{
+ if( ! ppdisp)
+ return E_POINTER;
+ CComPtr<IDispatch> spDisp;
+ spDisp.CoCreateInstance( L"XCallback_Impl.Simple");
+ *ppdisp= spDisp;
+ (*ppdisp)->AddRef();
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outInterface(IDispatch **ppdisp)
+{
+// return S_OK;
+ if( ! ppdisp)
+ return E_POINTER;
+ CComPtr<IDispatch> spDisp;
+ spDisp.CoCreateInstance( L"XCallback_Impl.Simple");
+ *ppdisp= spDisp;
+ (*ppdisp)->AddRef();
+
+// MessageBox( NULL, _T("CCallback::outInterface"), _T(""), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outValuesMixed(long val, long *pval, BSTR string)
+{
+
+ TCHAR buff[1024];
+ *pval = val+1;
+ wsprintf( buff, _T("param1: %d, param2 out: %d, param3: %s"), val, *pval, string);
+ MessageBox( NULL, buff, _T(""), MB_OK);
+ return S_OK;
+}
+
+
+STDMETHODIMP CCallback::outValuesAll(
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp,
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppSimpleStruct,
+ /* [out] */ long __RPC_FAR *aSimpleEnum,
+ /* [out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *outSeq,
+ /* [out] */ VARIANT __RPC_FAR *varAny,
+ /* [out] */ VARIANT_BOOL __RPC_FAR *aBool,
+ /* [out] */ short __RPC_FAR *aChar,
+ /* [out] */ BSTR __RPC_FAR *aString,
+ /* [out] */ float __RPC_FAR *aFloat,
+ /* [out] */ double __RPC_FAR *aDouble,
+ /* [out] */ unsigned char __RPC_FAR *aByte,
+ /* [out] */ short __RPC_FAR *aShort,
+ /* [out] */ long __RPC_FAR *aLong)
+//)
+{
+// if( ! ppdisp || ! ppSimpleStruct || ! aSimpleEnum ||
+// ! outSeq || !varAny ||! aBool || ! aChar ||
+// ! aString || ! aFloat || ! aDouble || ! aByte ||
+// ! aShort || ! aLong || ! aUShort || ! aULong)
+// return E_POINTER;
+
+ HRESULT hr=S_OK;
+ hr= outInterface( ppdisp);
+ hr= outStruct( ppSimpleStruct);
+ hr= outEnum( aSimpleEnum);
+ hr= outSeqAny( outSeq);
+ hr= outAny( varAny);
+ hr= outBool( aBool);
+ hr= outChar( aChar);
+ hr= outString( aString);
+ hr= outFloat( aFloat);
+ hr= outDouble( aDouble);
+ hr= outByte( aByte);
+ hr= outShort( aShort);
+ hr= outLong( aLong);
+ return hr;
+}
+
+STDMETHODIMP CCallback::outStruct(IDispatch **outStruct)
+{
+// return S_OK;
+ if( !outStruct)
+ return E_POINTER;
+ HRESULT hr= E_FAIL;
+// MessageBox( NULL, _T("CCallback::outStruct"), _T(""), MB_OK);
+
+ CComPtr<IDispatch> _dispMgr;
+ if( SUCCEEDED(hr= _dispMgr.CoCreateInstance(L"com.sun.star.ServiceManager")))
+ {
+ CComDispatchDriver manager( _dispMgr);
+ CComVariant param1(L"com.sun.star.reflection.CoreReflection");
+ CComVariant varRet;
+ hr= manager.Invoke1( L"createInstance", &param1, &varRet);
+
+ CComDispatchDriver reflection( varRet.pdispVal);
+ param1= L"oletest.SimpleStruct";
+ varRet.Clear();
+ hr= reflection.Invoke1( L"forName", &param1, &varRet);
+
+ CComDispatchDriver classSimpleStruct( varRet.pdispVal);
+
+ CComPtr<IDispatch> dispStruct;
+ param1.vt= VT_DISPATCH | VT_BYREF;
+ param1.ppdispVal= &dispStruct;
+ if( SUCCEEDED( hr= classSimpleStruct.Invoke1(L"createObject", &param1)))
+ {
+ // Set the value
+ CComDispatchDriver simpleStruct( dispStruct);
+ param1=L" this is a property string";
+ hr= simpleStruct.PutPropertyByName(L"message", &param1);
+ *outStruct= dispStruct;
+ (*outStruct)->AddRef();
+ hr= S_OK;
+ }
+ }
+ return hr;
+}
+
+STDMETHODIMP CCallback::outEnum(long *outEnum)
+{
+ if( !outEnum)
+ return E_POINTER;
+ *outEnum= 1;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outSeqAny(LPSAFEARRAY* outSeq)
+{
+// _CrtDbgBreak();
+ SAFEARRAY* pArr= SafeArrayCreateVector( VT_VARIANT, 0, 3);
+ CComVariant var[3];
+ var[0]=L" variant 0";
+ var[1]=L" variant 1";
+ var[2]=L"variant 2";
+ for( long i=0; i<3; i++)
+ {
+ SafeArrayPutElement( pArr, &i, (void*)&var[i]);
+ }
+
+ *outSeq= pArr;
+ return S_OK;
+}
+
+// ATLASSERT //VT_EMPTY
+
+
+STDMETHODIMP CCallback::outAny(VARIANT *outAny)
+{
+ if( ! outAny)
+ return E_POINTER;
+ outAny->vt= VT_BSTR;
+ outAny->bstrVal= SysAllocString( L"This is a string in a VARIANT");
+
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outBool(VARIANT_BOOL *outBool)
+{
+ if( ! outBool)
+ return E_POINTER;
+ *outBool= VARIANT_TRUE;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outChar(short *outChar)
+{
+ if( !outChar)
+ return E_POINTER;
+ *outChar= (short)L'A';
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outString(BSTR *outString)
+{
+ if( !outString)
+ return E_POINTER;
+ *outString= SysAllocString(L"This is a BSTR");
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outFloat(float *outFloat)
+{
+ if( !outFloat)
+ return E_POINTER;
+ *outFloat= 3.14;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outDouble(double *outDouble)
+{
+ if(!outDouble)
+ return E_POINTER;
+
+ *outDouble= 3.145;
+ return S_OK;
+}
+
+
+
+STDMETHODIMP CCallback::outShort(short *outShort)
+{
+ if(!outShort)
+ return E_POINTER;
+ *outShort= 0xffff;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outLong(long *outLong)
+{
+ if(!outLong)
+ return E_POINTER;
+ *outLong= 0xffffffff;
+ return S_OK;
+}
+
+
+
+STDMETHODIMP CCallback::outByte(unsigned char* outByte)
+{
+ if(!outByte)
+ return E_POINTER;
+ *outByte= 0xff;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutInterface(IDispatch **ppdisp)
+{
+ if( !ppdisp)
+ return E_POINTER;
+ CComDispatchDriver disp( *ppdisp);
+ CComVariant param1(L"");
+ disp.Invoke1(L"func", &param1);
+
+ (*ppdisp)->Release();
+
+ CComPtr<IDispatch> outDisp;
+ outDisp.CoCreateInstance( L"XCallback_Impl.Simple");
+ *ppdisp= outDisp;
+ (*ppdisp)->AddRef();
+
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutStruct(IDispatch **inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ HRESULT hr= S_OK;
+ USES_CONVERSION;
+ CComVariant var;
+ CComDispatchDriver disp( *inoutVal);
+
+ hr= disp.GetPropertyByName(L"message", &var);
+ MessageBox( NULL, W2T(var.bstrVal), _T("XCallback_Impl.Callback"), MB_OK);
+
+ (*inoutVal)->Release();
+
+ CComDispatchDriver dispStruct;
+ hr= outStruct( &dispStruct.p);
+ var.Clear();
+ var= L"This struct was created in XCallback_Imp.Callback";
+ hr= dispStruct.PutPropertyByName(L"message", &var);
+
+ *inoutVal= dispStruct;
+ (*inoutVal)->AddRef();
+ return hr;
+}
+
+STDMETHODIMP CCallback::inoutEnum(long *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal= *inoutVal+1;
+
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutSeqAny(LPSAFEARRAY *pArray)
+{
+ if( !pArray)
+ return E_POINTER;
+ HRESULT hr= S_OK;
+ long lbound=0;
+ long ubound=0;
+ hr= SafeArrayGetLBound( *pArray, 1, &lbound);
+ hr= SafeArrayGetUBound( *pArray, 1, &ubound);
+ long count= ubound - lbound + 1;
+
+ // the Array is supposet to contain variants
+ CComVariant var;
+ for( long i=0; i<count; i++)
+ {
+ var.Clear();
+ hr= SafeArrayGetElement( *pArray, &i, (void*)&var);
+ }
+
+ SafeArrayDestroy( *pArray);
+
+ outSeqAny( pArray);
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutAny(VARIANT *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ USES_CONVERSION;
+ if( inoutVal->vt= VT_BSTR)
+ MessageBox( NULL, W2T( inoutVal->bstrVal), _T("XCallback_Impl.Callback"), MB_OK);
+
+ VariantClear( inoutVal);
+ inoutVal->vt= VT_BSTR;
+ inoutVal->bstrVal=SysAllocString( L" [string] XCallback_Impl.Callback inoutAny");
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutBool(VARIANT_BOOL *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+
+ *inoutVal= *inoutVal == VARIANT_TRUE ? VARIANT_FALSE : VARIANT_TRUE;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutChar(short *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ USES_CONVERSION;
+ char buff[256];
+ sprintf( buff, "character value: %C", *inoutVal);
+ MessageBox( NULL, A2T(buff), _T("XCallback_Impl.Callback"), MB_OK);
+ *inoutVal= L'B';
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutString(BSTR *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ USES_CONVERSION;
+ MessageBox( NULL, W2T(*inoutVal), _T("XCallback_Impl.Callback"), MB_OK);
+ SysFreeString(*inoutVal);
+ *inoutVal= SysAllocString(L"a string from XCallback_Impl.Callback");
+
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutFloat(float *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal = *inoutVal+1;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutDouble(double *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal= *inoutVal+1;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutByte(unsigned char *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal= 0xff;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutShort(short *inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal= 0xffff;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutLong(long* inoutVal)
+{
+ if( !inoutVal)
+ return E_POINTER;
+ *inoutVal= 0xffffffff;
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inoutValuesAll(
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aXSimple,
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aStruct,
+ /* [out][in] */ long __RPC_FAR *aEnum,
+ /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *aSeq,
+ /* [out][in] */ VARIANT __RPC_FAR *aAny,
+ /* [out][in] */ VARIANT_BOOL __RPC_FAR *aBool,
+ /* [out][in] */ short __RPC_FAR *aChar,
+ /* [out][in] */ BSTR __RPC_FAR *aString,
+ /* [out][in] */ float __RPC_FAR *aFloat,
+ /* [out][in] */ double __RPC_FAR *aDouble,
+ /* [out][in] */ unsigned char __RPC_FAR *aByte,
+ /* [out][in] */ short __RPC_FAR *aShort,
+ /* [out][in] */ long __RPC_FAR *aLong)
+{
+ inoutInterface( aXSimple);
+ inoutStruct( aStruct);
+ inoutEnum( aEnum);
+ inoutSeqAny( aSeq);
+ inoutAny( aAny);
+ inoutBool( aBool);
+ inoutChar( aChar);
+ inoutString( aString);
+ inoutFloat( aFloat);
+ inoutDouble( aDouble);
+ inoutByte( aByte);
+ inoutShort( aShort);
+ inoutLong( aLong);
+
+ return S_OK;
+}
+
+
+STDMETHODIMP CCallback::inValues(short aChar, long aLong, BSTR aString)
+{
+ USES_CONVERSION;
+ wchar_t _char= (wchar_t) aChar;
+ char buff[1024];
+ sprintf( buff, "Parameters: char= %C, long= %d, string= %s", _char, aLong, W2A(aString));
+ MessageBox( NULL, A2T(buff), _T("XCallback_Impl.Callback"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::outSeqByte(LPSAFEARRAY * outVal)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
+
+STDMETHODIMP CCallback::inSeqByte( LPSAFEARRAY val)
+{
+ // TODO: Add your implementation code here
+
+ return S_OK;
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h
new file mode 100644
index 000000000000..4e6cbc3e85dc
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: Callback.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Callback.h : Declaration of the CCallback
+
+#ifndef __CALLBACK_H_
+#define __CALLBACK_H_
+
+#include "resource.h" // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CCallback
+class ATL_NO_VTABLE CCallback :
+ public CComObjectRootEx<CComSingleThreadModel>,
+ public CComCoClass<CCallback, &CLSID_Callback>,
+ public IDispatchImpl<ICallback, &IID_ICallback, &LIBID_XCALLBACK_IMPLLib>
+{
+public:
+ CCallback()
+ {
+ }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_CALLBACK)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CCallback)
+ COM_INTERFACE_ENTRY(ICallback)
+ COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// ICallback
+public:
+ STDMETHOD(inSeqByte)(/*[in]*/ LPSAFEARRAY val);
+ STDMETHOD(outSeqByte)(/*[out]*/ LPSAFEARRAY* outVal);
+ STDMETHOD(inValues)(/*[in]*/short aChar, /*[in]*/ long aLong, /*[in]*/ BSTR aString);
+ STDMETHOD(inoutLong)(/*[in,out]*/ long* inoutVal);
+ STDMETHOD(inoutShort)(/*[in,out]*/ short* inoutVal);
+ STDMETHOD(inoutByte)(/*[in,out]*/ unsigned char* inoutVal);
+ STDMETHOD(inoutDouble)(/*[in,out]*/ double* inoutVal);
+ STDMETHOD(inoutFloat)(/*[in,out]*/ float* inoutVal);
+ STDMETHOD(inoutString)(/*[in,out]*/ BSTR *inoutVal);
+ STDMETHOD(inoutChar)(/*[in,out]*/ short* inoutVal);
+ STDMETHOD(inoutBool)(/*[in,out]*/ VARIANT_BOOL * inoutVal);
+ STDMETHOD(inoutAny)(/*[in,out]*/ VARIANT* inoutVal);
+ STDMETHOD(inoutSeqAny)(/*[in,out]*/ LPSAFEARRAY* pArray);
+ STDMETHOD(inoutEnum)(/*[in,out]*/ long * inoutVal);
+ STDMETHOD(inoutStruct)(/*[in,out]*/ IDispatch** inoutVal);
+ STDMETHOD(inoutInterface)(/*[in,out]*/ IDispatch** ppdisp);
+ STDMETHOD(inoutValuesAll)(
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aXSimple,
+ /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aStruct,
+ /* [out][in] */ long __RPC_FAR *aEnum,
+ /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *aSeq,
+ /* [out][in] */ VARIANT __RPC_FAR *aAny,
+ /* [out][in] */ VARIANT_BOOL __RPC_FAR *aBool,
+ /* [out][in] */ short __RPC_FAR *aChar,
+ /* [out][in] */ BSTR __RPC_FAR *aString,
+ /* [out][in] */ float __RPC_FAR *aFloat,
+ /* [out][in] */ double __RPC_FAR *aDouble,
+ /* [out][in] */ unsigned char __RPC_FAR *aByte,
+ /* [out][in] */ short __RPC_FAR *aShort,
+ /* [out][in] */ long __RPC_FAR *aLong);
+
+ STDMETHOD(outByte)( unsigned char* outByte);
+ STDMETHOD(outLong)(/*[out]*/ long* outLong);
+ STDMETHOD(outShort)(/*[out]*/ short *outShort);
+ STDMETHOD(outDouble)(/*[out]*/ double* outDouble);
+ STDMETHOD(outFloat)(/*[out]*/ float* outFloat);
+ STDMETHOD(outString)(/*[out]*/ BSTR * outString);
+ STDMETHOD(outChar)(short* outChar);
+ STDMETHOD(outBool)(VARIANT_BOOL* outBool);
+ STDMETHOD(outAny)(VARIANT* outAny);
+ STDMETHOD(outSeqAny)(/*[out]*/LPSAFEARRAY* outSeq);
+ STDMETHOD(outEnum)(/*[out]*/ long* outEnum);
+ STDMETHOD(outStruct)(/*[out]*/ IDispatch** outStruct);
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE outValuesAll(
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp,
+ /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppSimpleStruct,
+ /* [out] */ long __RPC_FAR *aSimpleEnum,
+ /* [out] */ LPSAFEARRAY* outSeq,
+ /* [out] */ VARIANT __RPC_FAR *varAny,
+ /* [out] */ VARIANT_BOOL __RPC_FAR *aBool,
+ /* [out] */ short __RPC_FAR *aChar,
+ /* [out] */ BSTR __RPC_FAR *aString,
+ /* [out] */ float __RPC_FAR *aFloat,
+ /* [out] */ double __RPC_FAR *aDouble,
+ /* [out] */ unsigned char __RPC_FAR *aByte,
+ /* [out] */ short __RPC_FAR *aShort,
+ /* [out] */ long __RPC_FAR *aLong);
+// );
+//
+// STDMETHOD(outValuesAll)(
+// /*[out]*/ IDispatch** ppdisp,
+// /*[out]*/ IUnknown** ppSimpleStruct,
+// /*[out]*/ long* aSimpleEnum,
+// /*[out]*/ VARIANT* ArrayAny,
+// /*[out]*/ VARIANT* varAny,
+// /*[out]*/ VARIANT_BOOL * aBool,
+// /*[out]*/ unsigned short* aChar,
+// /*[out]*/ BSTR* aString, /*[out]*/ float* aFloat,
+// /*[out]*/ double* aDouble,
+// /*[out]*/ signed char* aByte, /*[out]*/ short* aShort, /*[out]*/long* aLong, /*[out]*/ unsigned short* aUShort, /*[out]*/ unsigned long* aULong);
+ STDMETHOD(outValuesMixed)(/*[in]*/ long val, /*[out]*/ long* pval, /*[in]*/ BSTR string);
+ STDMETHOD(outInterface)(/*[out]*/ IDispatch** ppdisp);
+ STDMETHOD(returnInterface)(/*[out, retval]*/ IDispatch** ppdisp);
+ STDMETHOD(func1)();
+};
+
+#endif //__CALLBACK_H_
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.rgs b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.rgs
new file mode 100644
index 000000000000..357c2946bc20
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ XCallback_Impl.Callback.1 = s 'Callback Class'
+ {
+ CLSID = s '{180FF560-6F5C-11D4-8330-005004526AB4}'
+ }
+ XCallback_Impl.Callback = s 'Callback Class'
+ {
+ CLSID = s '{180FF560-6F5C-11D4-8330-005004526AB4}'
+ CurVer = s 'XCallback_Impl.Callback.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {180FF560-6F5C-11D4-8330-005004526AB4} = s 'Callback Class'
+ {
+ ProgID = s 'XCallback_Impl.Callback.1'
+ VersionIndependentProgID = s 'XCallback_Impl.Callback'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{180FF553-6F5C-11D4-8330-005004526AB4}'
+ }
+ }
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp
new file mode 100644
index 000000000000..3c34244b8077
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: Simple.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Simple.cpp : Implementation of CSimple
+#include "stdafx.h"
+#include "XCallback_Impl.h"
+#include "Simple.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CSimple
+
+
+STDMETHODIMP CSimple::func(BSTR message)
+{
+ USES_CONVERSION;
+ MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
+ return S_OK;
+}
+
+
+STDMETHODIMP CSimple::func2(BSTR message)
+{
+ USES_CONVERSION;
+ MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
+ return S_OK;
+}
+
+STDMETHODIMP CSimple::func3(BSTR message)
+{
+ USES_CONVERSION;
+ MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
+ return S_OK;
+}
+
+
+STDMETHODIMP CSimple::get__implementedInterfaces(LPSAFEARRAY *pVal)
+{
+ HRESULT hr= S_OK;
+ SAFEARRAY *pArr= SafeArrayCreateVector( VT_BSTR, 0, 3);
+ if( pArr)
+ { long index=0;
+ BSTR name1= SysAllocString(L"oletest.XSimple");
+ BSTR name2= SysAllocString(L"oletest.XSimple2");
+ BSTR name3= SysAllocString(L"oletest.XSimple3");
+
+ hr= SafeArrayPutElement( pArr, & index, name1);
+ index++;
+ hr= SafeArrayPutElement( pArr, &index, name2);
+ index++;
+ hr= SafeArrayPutElement( pArr, &index, name3);
+ *pVal= pArr;
+
+ }
+ *pVal= pArr;
+ return S_OK;
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h
new file mode 100644
index 000000000000..7d82a662c4d5
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: Simple.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// Simple.h : Declaration of the CSimple
+
+#ifndef __SIMPLE_H_
+#define __SIMPLE_H_
+
+#include "resource.h" // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CSimple
+class ATL_NO_VTABLE CSimple :
+ public CComObjectRootEx<CComSingleThreadModel>,
+ public CComCoClass<CSimple, &CLSID_Simple>,
+ public IDispatchImpl<ISimple, &IID_ISimple, &LIBID_XCALLBACK_IMPLLib>
+{
+public:
+ CSimple()
+ {
+ }
+
+DECLARE_REGISTRY_RESOURCEID(IDR_SIMPLE)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CSimple)
+ COM_INTERFACE_ENTRY(ISimple)
+ COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+// ISimple
+public:
+
+ STDMETHOD(get__implementedInterfaces)(/*[out, retval]*/ LPSAFEARRAY *pVal);
+ STDMETHOD(func3)(/*[in]*/ BSTR message);
+ STDMETHOD(func2)(/*[in]*/ BSTR message);
+ STDMETHOD(func)( BSTR message);
+};
+
+#endif //__SIMPLE_H_
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.rgs b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.rgs
new file mode 100644
index 000000000000..9d5edbb2df32
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ XCallback_Impl.Simple.1 = s 'Simple Class'
+ {
+ CLSID = s '{180FF565-6F5C-11D4-8330-005004526AB4}'
+ }
+ XCallback_Impl.Simple = s 'Simple Class'
+ {
+ CLSID = s '{180FF565-6F5C-11D4-8330-005004526AB4}'
+ CurVer = s 'XCallback_Impl.Simple.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {180FF565-6F5C-11D4-8330-005004526AB4} = s 'Simple Class'
+ {
+ ProgID = s 'XCallback_Impl.Simple.1'
+ VersionIndependentProgID = s 'XCallback_Impl.Simple'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{180FF553-6F5C-11D4-8330-005004526AB4}'
+ }
+ }
+}
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp
new file mode 100644
index 000000000000..dc198a3b3234
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.cpp : source file that includes just the standard includes
+// stdafx.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h
new file mode 100644
index 000000000000..7d6946580cdc
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: StdAfx.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__180FF556_6F5C_11D4_8330_005004526AB4__INCLUDED_)
+#define AFX_STDAFX_H__180FF556_6F5C_11D4_8330_005004526AB4__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <stdio.h>
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+#include <stdio.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__180FF556_6F5C_11D4_8330_005004526AB4__INCLUDED)
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp
new file mode 100644
index 000000000000..1de669ab0b98
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: XCallback_Impl.cpp,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// XCallback_Impl.cpp : Implementation of DLL Exports.
+
+
+// Note: Proxy/Stub Information
+// To build a separate proxy/stub DLL,
+// run nmake -f XCallback_Implps.mk in the project directory.
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "XCallback_Impl.h"
+
+#include "XCallback_Impl_i.c"
+#include "Callback.h"
+#include "Simple.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_Callback, CCallback)
+OBJECT_ENTRY(CLSID_Simple, CSimple)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ _Module.Init(ObjectMap, hInstance, &LIBID_XCALLBACK_IMPLLib);
+ DisableThreadLibraryCalls(hInstance);
+ }
+ else if (dwReason == DLL_PROCESS_DETACH)
+ _Module.Term();
+ return TRUE; // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+ return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+ return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+ // registers object, typelib and all interfaces in typelib
+ return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+ return _Module.UnregisterServer(TRUE);
+}
+
+
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.dsp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.dsp
new file mode 100644
index 000000000000..871b32942b26
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.dsp
@@ -0,0 +1,335 @@
+# Microsoft Developer Studio Project File - Name="XCallback_Impl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=XCallback_Impl - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "XCallback_Impl.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "XCallback_Impl.mak" CFG="XCallback_Impl - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "XCallback_Impl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XCallback_Impl - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XCallback_Impl - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XCallback_Impl - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XCallback_Impl - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XCallback_Impl - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "XCallback_Impl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /ZI /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# Begin Custom Build - Performing registration
+OutDir=.\Debug
+TargetPath=.\Debug\XCallback_Impl.dll
+InputPath=.\Debug\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "XCallback_Impl - Win32 Unicode Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# Begin Custom Build - Performing registration
+OutDir=.\DebugU
+TargetPath=.\DebugU\XCallback_Impl.dll
+InputPath=.\DebugU\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "XCallback_Impl - Win32 Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinSize"
+# PROP BASE Intermediate_Dir "ReleaseMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinSize"
+# PROP Intermediate_Dir "ReleaseMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseMinSize
+TargetPath=.\ReleaseMinSize\XCallback_Impl.dll
+InputPath=.\ReleaseMinSize\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "XCallback_Impl - Win32 Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseMinDependency"
+# PROP Intermediate_Dir "ReleaseMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseMinDependency
+TargetPath=.\ReleaseMinDependency\XCallback_Impl.dll
+InputPath=.\ReleaseMinDependency\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "XCallback_Impl - Win32 Unicode Release MinSize"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinSize"
+# PROP BASE Intermediate_Dir "ReleaseUMinSize"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinSize"
+# PROP Intermediate_Dir "ReleaseUMinSize"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseUMinSize
+TargetPath=.\ReleaseUMinSize\XCallback_Impl.dll
+InputPath=.\ReleaseUMinSize\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "XCallback_Impl - Win32 Unicode Release MinDependency"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseUMinDependency"
+# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseUMinDependency"
+# PROP Intermediate_Dir "ReleaseUMinDependency"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# Begin Custom Build - Performing registration
+OutDir=.\ReleaseUMinDependency
+TargetPath=.\ReleaseUMinDependency\XCallback_Impl.dll
+InputPath=.\ReleaseUMinDependency\XCallback_Impl.dll
+SOURCE="$(InputPath)"
+
+"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ if "%OS%"=="" goto NOTNT
+ if not "%OS%"=="Windows_NT" goto NOTNT
+ regsvr32 /s /c "$(TargetPath)"
+ echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
+ goto end
+ :NOTNT
+ echo Warning : Cannot register Unicode DLL on Windows 95
+ :end
+
+# End Custom Build
+
+!ENDIF
+
+# Begin Target
+
+# Name "XCallback_Impl - Win32 Debug"
+# Name "XCallback_Impl - Win32 Unicode Debug"
+# Name "XCallback_Impl - Win32 Release MinSize"
+# Name "XCallback_Impl - Win32 Release MinDependency"
+# Name "XCallback_Impl - Win32 Unicode Release MinSize"
+# Name "XCallback_Impl - Win32 Unicode Release MinDependency"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Callback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Simple.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\XCallback_Impl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\XCallback_Impl.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\XCallback_Impl.idl
+# ADD MTL /tlb ".\XCallback_Impl.tlb" /h "XCallback_Impl.h" /iid "XCallback_Impl_i.c" /Oicf
+# End Source File
+# Begin Source File
+
+SOURCE=.\XCallback_Impl.rc
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Callback.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Simple.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Callback.rgs
+# End Source File
+# Begin Source File
+
+SOURCE=.\Simple.rgs
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl
new file mode 100644
index 000000000000..0e4aa1e37780
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: XCallback_Impl.idl,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+// XCallback_Impl.idl : IDL source for XCallback_Impl.dll
+//
+
+// This file will be processed by the MIDL tool to
+// produce the type library (XCallback_Impl.tlb) and marshalling code.
+
+import "oaidl.idl";
+import "ocidl.idl";
+ [
+ object,
+ uuid(180FF55F-6F5C-11D4-8330-005004526AB4),
+ dual,
+ helpstring("ICallback Interface"),
+ pointer_default(unique)
+ ]
+ interface ICallback : IDispatch
+ {
+ [id(1), helpstring("method func1")] HRESULT func1();
+ [id(2), helpstring("method returnInterface")] HRESULT returnInterface([out, retval] IDispatch** ppdisp);
+ [id(3), helpstring("method outInterface")] HRESULT outInterface([out] IDispatch** ppdisp);
+ [id(4), helpstring("method outValuesMixed")] HRESULT outValuesMixed([in] long val, [out] long* pval, [in] BSTR string);
+ [id(5), helpstring("method outValuesAll")] HRESULT outValuesAll([out] IDispatch** ppdisp, [out] IDispatch** ppSimpleStruct, [out] long* aSimpleEnum,
+ [out] SAFEARRAY( VARIANT)* outSeq,
+ [out] VARIANT* varAny,
+ [out] VARIANT_BOOL * aBool,
+ [out] short* aChar,
+ [out] BSTR* aString ,
+ [out] float* aFloat,
+ [out] double* aDouble,
+ [out] unsigned char* aByte,
+ [out] short* aShort,
+ [out]long* aLong);
+// );
+ [id(6), helpstring("method outStruct")] HRESULT outStruct([out] IDispatch** outStruct);
+ [id(7), helpstring("method outEnum")] HRESULT outEnum([out] long* outEnum);
+ [id(8), helpstring("method outSeqAny")] HRESULT outSeqAny([out] SAFEARRAY( VARIANT)* outSeq);
+ [id(9), helpstring("method outAny")] HRESULT outAny([out] VARIANT* outAny);
+ [id(10), helpstring("method outBool")] HRESULT outBool([out]VARIANT_BOOL* outBool);
+ [id(11), helpstring("method outChar")] HRESULT outChar([out] short* outChar);
+ [id(12), helpstring("method outString")] HRESULT outString([out] BSTR * outString);
+ [id(13), helpstring("method outFloat")] HRESULT outFloat([out] float* outFloat);
+ [id(14), helpstring("method outDouble")] HRESULT outDouble([out] double* outDouble);
+ [id(16), helpstring("method outShort")] HRESULT outShort([out] short *outShort);
+ [id(17), helpstring("method outLong")] HRESULT outLong([out] long* outLong);
+ [id(20), helpstring("method outByte")] HRESULT outByte([out] unsigned char* outByte);
+ [id(21), helpstring("method inoutInterface")] HRESULT inoutInterface([in,out] IDispatch** ppdisp);
+ [id(22), helpstring("method inoutStruct")] HRESULT inoutStruct([in,out] IDispatch** inoutVal);
+ [id(23), helpstring("method inoutEnum")] HRESULT inoutEnum([in,out] long * inoutVal);
+ [id(24), helpstring("method inoutSeqAny")] HRESULT inoutSeqAny([in,out] SAFEARRAY(VARIANT)* pArray);
+ [id(25), helpstring("method inoutAny")] HRESULT inoutAny([in,out] VARIANT* inoutVal);
+ [id(26), helpstring("method inoutBool")] HRESULT inoutBool([in,out] VARIANT_BOOL * inoutVal);
+ [id(27), helpstring("method inoutChar")] HRESULT inoutChar([in,out] short* inoutVal);
+ [id(28), helpstring("method inoutString")] HRESULT inoutString([in,out] BSTR *inoutVal);
+ [id(29), helpstring("method inoutFloat")] HRESULT inoutFloat([in,out] float* inoutVal);
+ [id(30), helpstring("method inoutDouble")] HRESULT inoutDouble([in,out] double* inoutVal);
+ [id(31), helpstring("method inoutByte")] HRESULT inoutByte([in,out] unsigned char* inoutVal);
+ [id(32), helpstring("method inoutShort")] HRESULT inoutShort([in,out] short* inoutVal);
+ [id(33), helpstring("method inoutLong")] HRESULT inoutLong([in,out] long* inoutVal);
+ [id(34), helpstring("method inoutValueAll")] HRESULT inoutValuesAll(
+ [in,out] IDispatch** aXSimple,
+ [in,out] IDispatch** aStruct,
+ [in,out] long* aEnum,
+ [in,out] SAFEARRAY( VARIANT)* aSeq,
+ [in,out] VARIANT* aAny,
+ [in,out] VARIANT_BOOL* aBool,
+ [in,out] short* aChar,
+ [in,out] BSTR* aString,
+ [in,out] float* aFloat,
+ [in,out] double* aDouble,
+ [in,out] unsigned char* aByte,
+ [in,out] short* aShort,
+ [in,out] long* aLong);
+ [id(35), helpstring("method inValues")] HRESULT inValues([in]short aChar, [in] long aLong, [in] BSTR aString);
+ [id(36), helpstring("method outSeqByte")] HRESULT outSeqByte([out] SAFEARRAY(unsigned char)* outVal);
+ [id(37), helpstring("method inSeqByte")] HRESULT inSeqByte([in] SAFEARRAY(unsigned char) val);
+
+ };
+ [
+ object,
+ uuid(180FF564-6F5C-11D4-8330-005004526AB4),
+ dual,
+ helpstring("ISimple Interface"),
+ pointer_default(unique)
+ ]
+ interface ISimple : IDispatch
+ {
+ [id(1), helpstring("method func")] HRESULT func( [in] BSTR message);
+ [id(2), helpstring("method func2")] HRESULT func2([in] BSTR message);
+ [id(3), helpstring("method func3")] HRESULT func3([in] BSTR message);
+ [propget, id(4), helpstring("property _implementedInterfaces")] HRESULT _implementedInterfaces([out, retval] SAFEARRAY(BSTR) *pVal);
+ };
+
+
+
+[
+ uuid(180FF553-6F5C-11D4-8330-005004526AB4),
+ version(1.0),
+ helpstring("XCallback_Impl 1.0 Type Library")
+]
+library XCALLBACK_IMPLLib
+{
+ importlib("stdole32.tlb");
+ importlib("stdole2.tlb");
+
+ [
+ uuid(180FF560-6F5C-11D4-8330-005004526AB4),
+ helpstring("Callback Class")
+ ]
+ coclass Callback
+ {
+ [default] interface ICallback;
+ };
+ [
+ uuid(180FF565-6F5C-11D4-8330-005004526AB4),
+ helpstring("Simple Class")
+ ]
+ coclass Simple
+ {
+ [default] interface ISimple;
+ };
+};
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.rc b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.rc
new file mode 100644
index 000000000000..1eb9f719e134
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.rc
@@ -0,0 +1,197 @@
+/*************************************************************************
+*
+* $RCSfile: XCallback_Impl.rc,v $
+*
+* $Revision: 1.1.1.1 $
+*
+* last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+*
+* The Contents of this file are made available subject to the terms of
+* either of the following licenses
+*
+* - GNU Lesser General Public License Version 2.1
+* - Sun Industry Standards Source License Version 1.1
+*
+* Sun Microsystems Inc., October, 2000
+*
+* GNU Lesser General Public License Version 2.1
+* =============================================
+* Copyright 2000 by Sun Microsystems, Inc.
+* 901 San Antonio Road, Palo Alto, CA 94303, USA
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License version 2.1, as published by the Free Software Foundation.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+* MA 02111-1307 USA
+*
+*
+* Sun Industry Standards Source License Version 1.1
+* =================================================
+* The contents of this file are subject to the Sun Industry Standards
+* Source License Version 1.1 (the "License"); You may not use this file
+* except in compliance with the License. You may obtain a copy of the
+* License at http://www.openoffice.org/license.html.
+*
+* Software provided under this License is provided on an "AS IS" basis,
+* WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+* WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+* See the License for the specific provisions governing your rights and
+* obligations concerning the Software.
+*
+* The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+*
+* Copyright: 2000 by Sun Microsystems, Inc.
+*
+* All Rights Reserved.
+*
+* Contributor(s): _______________________________________
+*
+*
+*
+**************************************************************************/
+
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// German (Germany) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// REGISTRY
+//
+
+IDR_CALLBACK REGISTRY DISCARDABLE "Callback.rgs"
+IDR_SIMPLE REGISTRY DISCARDABLE "Simple.rgs"
+#endif // German (Germany) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""winres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "1 TYPELIB ""XCallback_Impl.tlb""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "XCallback_Impl Module\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "XCallback_Impl\0"
+ VALUE "LegalCopyright", "Copyright 2000\0"
+ VALUE "OriginalFilename", "XCallback_Impl.DLL\0"
+ VALUE "ProductName", "XCallback_Impl Module\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ VALUE "OLESelfRegister", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROJNAME "XCallback_Impl"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "XCallback_Impl.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h
new file mode 100644
index 000000000000..c1ec49db25cd
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: resource.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by XCallback_Impl.rc
+//
+#define IDS_PROJNAME 100
+#define IDR_CALLBACK 101
+#define IDR_SIMPLE 102
+#define IDR_SIMPLESTRUCT 103
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 201
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 201
+#define _APS_NEXT_SYMED_VALUE 104
+#endif
+#endif
diff --git a/extensions/test/ole/unoTocomCalls/readme.txt b/extensions/test/ole/unoTocomCalls/readme.txt
new file mode 100644
index 000000000000..d02b1357af83
--- /dev/null
+++ b/extensions/test/ole/unoTocomCalls/readme.txt
@@ -0,0 +1,6 @@
+The directory XCallback_Impl contains a MSDEV project that
+creates a dll containing the ActiveX components
+XCallback_Impl.Simple and XCallback_Impl.Callback
+Callback implements functions defined in oletest.XCallback
+and Simple implements functions defined in oletest.XSimple.
+These interfaces are build in extensions/test/ole/cpnt \ No newline at end of file