From 3481ba93eabba9da810593a96e69900a62fc3052 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 16 Jul 2009 11:33:46 +0000 Subject: CWS-TOOLING: integrate CWS jl129 2009-07-08 09:24:14 +0200 jl r273817 : #i103275# catching DisposedException when calling XDesktop.terminate, the test librariesversion_3_0_0.dll, ..3_0_1.dll, .. 3.1.dll have been recreated and checked in 2009-07-08 09:20:29 +0200 jl r273816 : # 2009-07-07 10:51:52 +0200 jl r273784 : #103378# allow to pass Nothing in Basic for uno null reference 2009-07-07 10:30:48 +0200 jl r273781 : #103242# VS 2008 changes 2009-07-07 10:21:23 +0200 jl r273778 : #103242 2009-07-07 10:12:20 +0200 jl r273777 : #103242 adapting to VS 2008 2009-07-03 09:47:21 +0200 jl r273679 : #i10324# fix build errors 2009-07-03 09:12:08 +0200 jl r273677 : #i10324# fix build errors 2009-07-02 15:26:07 +0200 jl r273657 : #i103242 make it build again 2009-07-02 14:39:34 +0200 jl r273652 : #i103242 make it build again 2009-07-02 14:18:45 +0200 jl r273650 : #i103242 remove warnings 2009-07-02 14:11:48 +0200 jl r273648 : #i103242 2009-07-02 12:41:23 +0200 jl r273637 : #i103242 2009-07-02 12:25:09 +0200 jl r273636 : #i103242 upgraded to VS2008 2009-07-02 12:00:07 +0200 jl r273632 : #i103242 upgraded to VS2008 2009-07-02 11:30:55 +0200 jl r273630 : #i103242 test does not build anymore 2009-07-02 11:14:21 +0200 jl r273629 : #i103242 test does not build anymore 2009-07-02 10:59:56 +0200 jl r273628 : #i103242 test does not build anymore 2009-07-02 10:17:43 +0200 jl r273622 : #i103242 run test prints out the InnerException in case there was an exception. The InnerException is usually the one thrown in OOo 2009-07-01 17:06:24 +0200 jl r273604 : #i103242 test does not build anymore --- extensions/source/ole/unoconversionutilities.hxx | 27 +- .../test/ole/AxTestComponents/AxTestComponents.def | 8 +- .../test/ole/AxTestComponents/AxTestComponents.sln | 64 +- .../ole/AxTestComponents/AxTestComponents.vcproj | 1435 +++++++++++--------- .../test/ole/DCOM/Clients/WriterDemo/readme.txt | 8 +- .../EventListener/EventListener.def | 8 +- .../EventListener/EventListener.dsp | 323 ----- .../EventListener/EventListener.dsw | 29 - .../EventListener/EventListener.sln | 32 + .../EventListener/EventListener.vcproj | 927 +++++++++++++ extensions/test/ole/EventListenerSample/events.htm | 196 +-- extensions/test/ole/EventListenerSample/readme.txt | 38 +- extensions/test/ole/MfcControl/MfcControl.def | 8 +- extensions/test/ole/MfcControl/MfcControl.rc | 2 +- extensions/test/ole/MfcControl/MfcControl.sln | 52 +- extensions/test/ole/MfcControl/MfcControl.vcproj | 981 +++++++------ extensions/test/ole/OleClient/axhost.cxx | 2 +- extensions/test/ole/OleClient/clientTest.cxx | 12 +- extensions/test/ole/OleClient/funcs.cxx | 3 + extensions/test/ole/OleClient/readme.txt | 26 +- extensions/test/ole/OleConverterVar1/convTest.cxx | 1 + extensions/test/ole/OleConverterVar1/readme.txt | 18 +- .../test/ole/StarBasic_OleClient/oleclient.bas | 7 +- extensions/test/ole/StarBasic_OleClient/readme.txt | 20 +- extensions/test/ole/VisualBasic/AssemblyInfo.vb | 33 + extensions/test/ole/VisualBasic/Form1.frm | 349 ----- extensions/test/ole/VisualBasic/Module1.bas | 858 ------------ extensions/test/ole/VisualBasic/Module1.vb | 853 ++++++++++++ extensions/test/ole/VisualBasic/Project1.sln | 20 + extensions/test/ole/VisualBasic/Project1.vbp | 34 - extensions/test/ole/VisualBasic/Project1.vbproj | 90 ++ extensions/test/ole/VisualBasic/Project1.vbw | 1 - extensions/test/ole/VisualBasic/readme.txt | 36 +- extensions/test/ole/cpnt/cpnt.cxx | 49 +- extensions/test/ole/cpnt/readme.txt | 26 +- extensions/test/ole/cppToUno/testcppuno.cxx | 38 +- extensions/test/ole/cpptest/StdAfx.cpp | 37 - extensions/test/ole/cpptest/StdAfx.h | 54 - extensions/test/ole/cpptest/cpptest.cpp | 124 -- extensions/test/ole/cpptest/cpptest.cxx | 53 +- extensions/test/ole/cpptest/cpptest.dsp | 114 -- extensions/test/ole/cpptest/cpptest.dsw | 30 - extensions/test/ole/cpptest/readme.txt | 6 +- extensions/test/ole/unloading/readme.txt | 12 +- extensions/test/ole/unloading/unloadTest.cxx | 2 +- extensions/test/ole/unoTocomCalls/Test/Test.sln | 40 +- extensions/test/ole/unoTocomCalls/Test/Test.vcproj | 407 +++--- .../ole/unoTocomCalls/XCallback_Impl/Callback.cpp | 6 +- .../XCallback_Impl/XCallback_Impl.def | 8 +- .../XCallback_Impl/XCallback_Impl.sln | 64 +- .../XCallback_Impl/XCallback_Impl.vcproj | 1392 +++++++++++-------- extensions/test/ole/unoTocomCalls/readme.txt | 18 +- 52 files changed, 4840 insertions(+), 4141 deletions(-) delete mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.dsp delete mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.dsw create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.sln create mode 100644 extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj create mode 100644 extensions/test/ole/VisualBasic/AssemblyInfo.vb delete mode 100644 extensions/test/ole/VisualBasic/Form1.frm delete mode 100644 extensions/test/ole/VisualBasic/Module1.bas create mode 100644 extensions/test/ole/VisualBasic/Module1.vb create mode 100644 extensions/test/ole/VisualBasic/Project1.sln delete mode 100644 extensions/test/ole/VisualBasic/Project1.vbp create mode 100644 extensions/test/ole/VisualBasic/Project1.vbproj delete mode 100644 extensions/test/ole/VisualBasic/Project1.vbw delete mode 100644 extensions/test/ole/cpptest/StdAfx.cpp delete mode 100644 extensions/test/ole/cpptest/StdAfx.h delete mode 100644 extensions/test/ole/cpptest/cpptest.cpp delete mode 100644 extensions/test/ole/cpptest/cpptest.dsp delete mode 100644 extensions/test/ole/cpptest/cpptest.dsw (limited to 'extensions') diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 1ed12a759877..8a44ec603b7f 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -1684,7 +1684,8 @@ Any UnoConversionUtilities::createOleObjectWrapper(VARIANT* pVar, const Type& Any UnoConversionUtilities::createOleObjectWrapper(VARIANT* pVar, const Type& aType= Type()) #endif { - if (pVar->vt != VT_UNKNOWN && pVar->vt != VT_DISPATCH) + //To allow passing "Nothing" in VS 2008 we need to accept VT_EMPTY + if (pVar->vt != VT_UNKNOWN && pVar->vt != VT_DISPATCH && pVar->vt != VT_EMPTY) throw IllegalArgumentException( OUSTR("[automation bridge]UnoConversionUtilities::createOleObjectWrapper \n" "The VARIANT does not contain an object type! "), 0, -1); @@ -1719,13 +1720,23 @@ Any UnoConversionUtilities::createOleObjectWrapper(VARIANT* pVar, const Type& Any ret; //If no Type is provided and pVar contains IUnknown then we return a XInterface. //If pVar contains an IDispatch then we return a XInvocation. - Type desiredType; - if (aType == VOID_TYPE && pVar->vt == VT_UNKNOWN) - desiredType = getCppuType((Reference*) 0); - else if (aType == VOID_TYPE && pVar->vt == VT_DISPATCH) - desiredType = getCppuType((Reference*) 0); - else - desiredType = aType; + Type desiredType = aType; + + if (aType == VOID_TYPE) + { + switch (pVar->vt) + { + case VT_EMPTY: + case VT_UNKNOWN: + desiredType = getCppuType((Reference*) 0); + break; + case VT_DISPATCH: + desiredType = getCppuType((Reference*) 0); + break; + default: + desiredType = aType; + } + } // COM pointer are NULL, no wrapper required if (spUnknown == NULL) diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.def b/extensions/test/ole/AxTestComponents/AxTestComponents.def index 6c19f0c53300..5d8c019adefc 100644 --- a/extensions/test/ole/AxTestComponents/AxTestComponents.def +++ b/extensions/test/ole/AxTestComponents/AxTestComponents.def @@ -3,7 +3,7 @@ LIBRARY "AxTestComponents.DLL" EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.sln b/extensions/test/ole/AxTestComponents/AxTestComponents.sln index 669a59cef405..eadaa373ed94 100644 --- a/extensions/test/ole/AxTestComponents/AxTestComponents.sln +++ b/extensions/test/ole/AxTestComponents/AxTestComponents.sln @@ -1,33 +1,31 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AxTestComponents", "AxTestComponents.vcproj", "{CF6DC513-B04E-420A-A0F9-6D1F4046D098}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release MinDependency = Release MinDependency - Release MinSize = Release MinSize - Unicode Debug = Unicode Debug - Unicode Release MinDependency = Unicode Release MinDependency - Unicode Release MinSize = Unicode Release MinSize - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug.ActiveCfg = Debug|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug.Build.0 = Debug|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency.ActiveCfg = Release MinDependency|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency.Build.0 = Release MinDependency|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize.ActiveCfg = Release MinSize|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize.Build.0 = Release MinSize|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug.Build.0 = Unicode Debug|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency.ActiveCfg = Unicode Release MinDependency|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency.Build.0 = Unicode Release MinDependency|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize.ActiveCfg = Unicode Release MinSize|Win32 - {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize.Build.0 = Unicode Release MinSize|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AxTestComponents", "AxTestComponents.vcproj", "{CF6DC513-B04E-420A-A0F9-6D1F4046D098}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release MinDependency|Win32 = Release MinDependency|Win32 + Release MinSize|Win32 = Release MinSize|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32 + Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug|Win32.ActiveCfg = Debug|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Debug|Win32.Build.0 = Debug|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Release MinSize|Win32.Build.0 = Release MinSize|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32 + {CF6DC513-B04E-420A-A0F9-6D1F4046D098}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.vcproj b/extensions/test/ole/AxTestComponents/AxTestComponents.vcproj index c925c7d6b2b3..078daba3da2f 100644 --- a/extensions/test/ole/AxTestComponents/AxTestComponents.vcproj +++ b/extensions/test/ole/AxTestComponents/AxTestComponents.vcproj @@ -1,616 +1,819 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt b/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt index cc16cd810e3c..1d5a63492126 100644 --- a/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt +++ b/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt @@ -1,4 +1,4 @@ -Visual Basic client that instantiates a Windows Script Component -,dcomtest.writerdemo.wsc. That component is located in -extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc. -Don't forget to register that component (right-click,select register). \ No newline at end of file +Visual Basic client that instantiates a Windows Script Component +,dcomtest.writerdemo.wsc. That component is located in +extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc. Don't forget to +register that component (right-click,select register). diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.def b/extensions/test/ole/EventListenerSample/EventListener/EventListener.def index 9e4eab1df62c..9d88a68f7f39 100644 --- a/extensions/test/ole/EventListenerSample/EventListener/EventListener.def +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.def @@ -3,7 +3,7 @@ LIBRARY "EventListener.DLL" EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsp b/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsp deleted file mode 100644 index 08aac8247c0a..000000000000 --- a/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsp +++ /dev/null @@ -1,323 +0,0 @@ -# Microsoft Developer Studio Project File - Name="EventListener" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** NICHT BEARBEITEN ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=EventListener - Win32 Debug -!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE -!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl -!MESSAGE -!MESSAGE NMAKE /f "EventListener.mak". -!MESSAGE -!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben -!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: -!MESSAGE -!MESSAGE NMAKE /f "EventListener.mak" CFG="EventListener - Win32 Debug" -!MESSAGE -!MESSAGE Für die Konfiguration stehen zur Auswahl: -!MESSAGE -!MESSAGE "EventListener - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE "EventListener - Win32 Unicode Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE "EventListener - Win32 Release MinSize" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE "EventListener - Win32 Release MinDependency" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE "EventListener - Win32 Unicode Release MinSize" (basierend auf "Win32 (x86) Dynamic-Link Library") -!MESSAGE "EventListener - Win32 Unicode Release MinDependency" (basierend auf "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)" == "EventListener - 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" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\Debug\EventListener.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)" == "EventListener - 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 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\DebugU\EventListener.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)" == "EventListener - 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 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\ReleaseMinSize\EventListener.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)" == "EventListener - 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 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\ReleaseMinDependency\EventListener.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)" == "EventListener - 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 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\ReleaseUMinSize\EventListener.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)" == "EventListener - 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 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /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\EventListener.dll -InputPath=.\ReleaseUMinDependency\EventListener.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 "EventListener - Win32 Debug" -# Name "EventListener - Win32 Unicode Debug" -# Name "EventListener - Win32 Release MinSize" -# Name "EventListener - Win32 Release MinDependency" -# Name "EventListener - Win32 Unicode Release MinSize" -# Name "EventListener - 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=.\EventListener.cpp -# End Source File -# Begin Source File - -SOURCE=.\EventListener.def -# End Source File -# Begin Source File - -SOURCE=.\EventListener.idl -# ADD MTL /tlb ".\EventListener.tlb" /h "EventListener.h" /iid "EventListener_i.c" /Oicf -# End Source File -# Begin Source File - -SOURCE=.\EventListener.rc -# End Source File -# Begin Source File - -SOURCE=.\EvtListener.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=.\EvtListener.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=.\EvtListener.rgs -# End Source File -# End Group -# End Target -# End Project diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsw b/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsw deleted file mode 100644 index 20f5e80a4ee6..000000000000 --- a/extensions/test/ole/EventListenerSample/EventListener/EventListener.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "EventListener"=.\EventListener.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln b/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln new file mode 100644 index 000000000000..8420bb49259a --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EventListener", "EventListener.vcproj", "{055137B6-A402-4913-AC11-9A096E866F5B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release MinDependency|Win32 = Release MinDependency|Win32 + Release MinSize|Win32 = Release MinSize|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32 + Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.ActiveCfg = Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Debug|Win32.Build.0 = Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Release MinSize|Win32.Build.0 = Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32 + {055137B6-A402-4913-AC11-9A096E866F5B}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj b/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj new file mode 100644 index 000000000000..e8aef55323bb --- /dev/null +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.vcproj @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/EventListenerSample/events.htm b/extensions/test/ole/EventListenerSample/events.htm index a9ac88bd11ec..973a21528643 100644 --- a/extensions/test/ole/EventListenerSample/events.htm +++ b/extensions/test/ole/EventListenerSample/events.htm @@ -1,98 +1,98 @@ - - - - -Document Title - - - - - - -

-The script on this page creates a new StarOffice document and connects an event listener -to it. When the document is closed then the XEventListener::disposing method is called on the -listener object. How the listener is set up depends on the button being clicked. -

-

-The button will run JScript code that and adds an JScript event listener to the document. -The listener is also implemented in JScript an is on this page.. -

- -

- -The button runs JScript code that creates the ActiveX component EventListener.EvtListener that -is written in C++ and housed in a dll. Then the event listener is added to the document. -

- -

-The button runs VBScript code that creates the components EventListener.EvtListener and adds it -to the document. -

- -

-Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was -written with VB -

- - - - - - + + + + +Document Title + + + + + + +

+The script on this page creates a new StarOffice document and connects an event listener +to it. When the document is closed then the XEventListener::disposing method is called on the +listener object. How the listener is set up depends on the button being clicked. +

+

+The button will run JScript code that and adds an JScript event listener to the document. +The listener is also implemented in JScript an is on this page.. +

+ +

+ +The button runs JScript code that creates the ActiveX component EventListener.EvtListener that +is written in C++ and housed in a dll. Then the event listener is added to the document. +

+ +

+The button runs VBScript code that creates the components EventListener.EvtListener and adds it +to the document. +

+ +

+Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was +written with VB +

+ + + + + + diff --git a/extensions/test/ole/EventListenerSample/readme.txt b/extensions/test/ole/EventListenerSample/readme.txt index 46c674153ab7..6485571ec928 100644 --- a/extensions/test/ole/EventListenerSample/readme.txt +++ b/extensions/test/ole/EventListenerSample/readme.txt @@ -1,18 +1,20 @@ -EventListener -________________________________________________________ - -The folder EventListener contains an MSDEV project that builds a dll that contains -the EventListener.EvtListener ActiveX component. The component implements the XEventListener -interface according to the rules of the OleBridge. The component will be used from the -HTML page events.htm. - -VBEventListener: -_________________________________________________________ -Contains a Visual Basic project that builds an ActiveX component that implements -com.sun.star.lang.XEventListener. Its ProgId is VBasicEventListener.VBEventListener -The dll should also be checked in. VB needs its TLB, so it uses the same CLSIDs on -the next build. The component will create a message box when its disposing function -has been called. - -The project also contains a client that builds a Project1.exe (in the same folder) -that creates VBEventListener and adds it to a StarOffice document +EventListener +======================================== + +The folder EventListener contains an MSDEV project that builds a dll that +contains the EventListener.EvtListener ActiveX component. The component +implements the XEventListener interface according to the rules of the +OleBridge. The component will be used from the HTML page events.htm. + + +VBEventListener: +======================================== + +Contains a Visual Basic project that builds an ActiveX component that implements +com.sun.star.lang.XEventListener. Its ProgId is +VBasicEventListener.VBEventListener The dll should also be checked in. VB needs +its TLB, so it uses the same CLSIDs on the next build. The component will create +a message box when its disposing function has been called. + +The project also contains a client that builds a Project1.exe (in the same +folder) that creates VBEventListener and adds it to a StarOffice document diff --git a/extensions/test/ole/MfcControl/MfcControl.def b/extensions/test/ole/MfcControl/MfcControl.def index 86cc2a0f8c47..8c164a7b5399 100644 --- a/extensions/test/ole/MfcControl/MfcControl.def +++ b/extensions/test/ole/MfcControl/MfcControl.def @@ -3,7 +3,7 @@ LIBRARY "MFCCONTROL.OCX" EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/extensions/test/ole/MfcControl/MfcControl.rc b/extensions/test/ole/MfcControl/MfcControl.rc index ce8375871fbc..e052b9f261a6 100644 --- a/extensions/test/ole/MfcControl/MfcControl.rc +++ b/extensions/test/ole/MfcControl/MfcControl.rc @@ -84,7 +84,7 @@ END // Bitmap // -IDB_MFCCONTROL BITMAP DISCARDABLE "MfcControlCtl.bmp" +//IDB_MFCCONTROL BITMAP DISCARDABLE "MfcControlCtl.bmp" ///////////////////////////////////////////////////////////////////////////// // diff --git a/extensions/test/ole/MfcControl/MfcControl.sln b/extensions/test/ole/MfcControl/MfcControl.sln index 77d3f99d6621..24e646c8626b 100644 --- a/extensions/test/ole/MfcControl/MfcControl.sln +++ b/extensions/test/ole/MfcControl/MfcControl.sln @@ -1,27 +1,25 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcControl", "MfcControl.vcproj", "{07D59661-3519-4F10-AE9F-22DB0479E25A}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - ConfigName.2 = Unicode Debug - ConfigName.3 = Unicode Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug.ActiveCfg = Debug|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug.Build.0 = Debug|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release.ActiveCfg = Release|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release.Build.0 = Release|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug.Build.0 = Unicode Debug|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release.ActiveCfg = Unicode Release|Win32 - {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release.Build.0 = Unicode Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcControl", "MfcControl.vcproj", "{07D59661-3519-4F10-AE9F-22DB0479E25A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Release|Win32 = Unicode Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug|Win32.ActiveCfg = Debug|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Debug|Win32.Build.0 = Debug|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release|Win32.ActiveCfg = Release|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Release|Win32.Build.0 = Release|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {07D59661-3519-4F10-AE9F-22DB0479E25A}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/MfcControl/MfcControl.vcproj b/extensions/test/ole/MfcControl/MfcControl.vcproj index 2fa53b2e67ee..6099d8242de6 100644 --- a/extensions/test/ole/MfcControl/MfcControl.vcproj +++ b/extensions/test/ole/MfcControl/MfcControl.vcproj @@ -1,400 +1,581 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/OleClient/axhost.cxx b/extensions/test/ole/OleClient/axhost.cxx index e6f42363f49d..b57860327560 100644 --- a/extensions/test/ole/OleClient/axhost.cxx +++ b/extensions/test/ole/OleClient/axhost.cxx @@ -46,7 +46,7 @@ HostWin::~HostWin() } -LRESULT HostWin::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +LRESULT HostWin::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { CAxWindow wnd(m_hWnd); diff --git a/extensions/test/ole/OleClient/clientTest.cxx b/extensions/test/ole/OleClient/clientTest.cxx index be5037c35619..112f5a1512d9 100644 --- a/extensions/test/ole/OleClient/clientTest.cxx +++ b/extensions/test/ole/OleClient/clientTest.cxx @@ -86,7 +86,7 @@ void printResultVariantArray( VARIANT & var); void printVariant( VARIANT & var); void printSequence( Sequence& val); -extern "C" int __cdecl main( int argc, char * argv[] ) +extern "C" int __cdecl main( int , char **) { HRESULT hr; if( FAILED( hr=CoInitialize(NULL))) @@ -381,7 +381,7 @@ bool doPropertyTest(const Reference & inv) Any inrefVariant, outrefVariant; Any inrefDecimal, outrefDecimal; Any inParamsLong, outParamsLong; - Reference xintUnknown = getComObject(L"AxTestComponents.Foo"); + Reference xintUnknown(getComObject(L"AxTestComponents.Foo")); inBool <<= (sal_Bool) sal_True; inv->setValue(OUString(L"prpBool"), inBool); @@ -391,7 +391,7 @@ bool doPropertyTest(const Reference & inv) inv->setValue(OUString(L"prpByte"), inByte); outByte = inv->getValue(OUString(L"prpByte")); - inShort <<= ( sal_Int16) 0xffff; + inShort <<= static_cast( -1); inv->setValue(OUString(L"prpShort"), inShort); outShort = inv->getValue(OUString(L"prpShort")); @@ -659,7 +659,7 @@ bool doSimpleTest(const Reference & inv) Any inrefVariant, outrefVariant; Any inrefDecimal, outrefDecimal; - Reference xIntFoo = getComObject(L"AxTestComponents.Foo"); + Reference xIntFoo(getComObject(L"AxTestComponents.Foo")); //################################################################################### // in and out parameter //################################################################################### @@ -678,7 +678,7 @@ bool doSimpleTest(const Reference & inv) inv->invoke(OUString(L"outByte"), Sequence< Any > ( & outByte, 1), seqIndices, seqOut); outByte <<= seqOut[0]; - inShort <<= ( sal_Int16) 0xffff; + inShort <<= static_cast(-1); inv->invoke(OUString(L"inShort"), Sequence< Any > ( & inShort, 1), seqIndices, seqOut); seqIndices.realloc( 0); seqOut.realloc(0); @@ -1221,7 +1221,7 @@ HRESULT doTest() // invMfc->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); if ( ! invMfc.is()) return hr; - aAny <<= ( sal_Int16) 0xffff; + aAny <<= static_cast(-1); aAny= invMfc->invoke( OUString(L"inShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); // diff --git a/extensions/test/ole/OleClient/funcs.cxx b/extensions/test/ole/OleClient/funcs.cxx index f6900e44d4cd..1c58da6743cd 100644 --- a/extensions/test/ole/OleClient/funcs.cxx +++ b/extensions/test/ole/OleClient/funcs.cxx @@ -42,6 +42,7 @@ #include "com/sun/star/uno/TypeClass.hpp" #include "com/sun/star/script/XInvocation.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/uno/XComponentContext.hpp" #include #include "rtl/ustring.hxx" @@ -276,6 +277,7 @@ bool equalSequences(const Any& orig, const Any& returned) default: return false; } + return false; } template< class T > @@ -292,6 +294,7 @@ bool equalSequences(const Sequence& seqIn, const Sequence & seqOut) if (anyIn != anyOut) return false; } + return true; } diff --git a/extensions/test/ole/OleClient/readme.txt b/extensions/test/ole/OleClient/readme.txt index dfbeec3b6623..96181e44db9b 100644 --- a/extensions/test/ole/OleClient/readme.txt +++ b/extensions/test/ole/OleClient/readme.txt @@ -1,16 +1,10 @@ -The program tests the OleObjectFactory service which enables to use COM components -through XInvocation. - -Requirements: - -types.rdb and services.rdb and OleClient.ini have to be next to the executable. -COM component: XCallback_Impl.Simple ( extensions/test/ole/unotocomcalls/XCallback_Impl ) -ActiveX controls: AxTestComponent.Basic ( extensions/test/ole/AxTestComponents) - MFCCONTROL.MfcControlCtrl.1 (extensions/test/ole/MfcControl) - -//The project cannot be build in our environment therefore it must be an MSDEV project. -//Reason: ATL uses min and max macros defined in windef.h. Our stl header undef min and max. -//To generate the uno header use the make file. Then Set the include path directories to -//the inc directory in the build tree. - -Now with Visual Studio .NET 2002 it seems to work +The program tests the OleObjectFactory service which enables to use COM components +through XInvocation. + +Requirements: + +types.rdb and services.rdb and OleClient.ini have to be next to the executable. +COM component: XCallback_Impl.Simple ( extensions/test/ole/unotocomcalls/XCallback_Impl ) +ActiveX controls: AxTestComponent.Basic ( extensions/test/ole/AxTestComponents) + MFCCONTROL.MfcControlCtrl.1 (extensions/test/ole/MfcControl) + diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx index 2b1e02b5266d..3671ec00b429 100644 --- a/extensions/test/ole/OleConverterVar1/convTest.cxx +++ b/extensions/test/ole/OleConverterVar1/convTest.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" +#pragma warning (disable: 4917) #include #include #include diff --git a/extensions/test/ole/OleConverterVar1/readme.txt b/extensions/test/ole/OleConverterVar1/readme.txt index 11bf9c37d842..148bab04c147 100644 --- a/extensions/test/ole/OleConverterVar1/readme.txt +++ b/extensions/test/ole/OleConverterVar1/readme.txt @@ -1,8 +1,10 @@ -The program test the Service com.sun.star.bridge.OleBridgeSupplierVar1. -While running in debug mode it writes infos to the debug - output. - -The executable needs a applicat.rdb present with the registered services -com.sun.star.bridge.OleBridgeSupplierVar1, oletest.OleTest. The OleTest -component resides in extensions/test/ole/cpnt. The build creates an -oletest.rdb file that must be merged with the applicat.rdb and OleTest -must be registered to the applicat.rdb. \ No newline at end of file +Currently broken!! + +The program test the Service com.sun.star.bridge.OleBridgeSupplierVar1. +While running in debug mode it writes infos to the debug - output. + +The executable needs a services.rdb present with the registered services +com.sun.star.bridge.OleBridgeSupplierVar1, oletest.OleTest. The OleTest +component resides in extensions/test/ole/cpnt. The build creates an +oletest.rdb file that must be merged with the types.rdb and OleTest +must be registered to the services.rdb. diff --git a/extensions/test/ole/StarBasic_OleClient/oleclient.bas b/extensions/test/ole/StarBasic_OleClient/oleclient.bas index 2fdd1db67859..7ba324660dfe 100644 --- a/extensions/test/ole/StarBasic_OleClient/oleclient.bas +++ b/extensions/test/ole/StarBasic_OleClient/oleclient.bas @@ -350,10 +350,11 @@ inLong = 0 inFloat = 0 inVariant = 0 inVariant2 = 0 -'defaults are: 1, 2. , 3, 4 +'defaults are: 1, 2, 4 +'The third parameter is a VARIANT with a default value of 4. COM gives it the type BSTR obj.defaultvalue1() obj.defaultvalue2(inLong, inFloat, inVariant) -If inLong <> 1 Or inFloat <> 2 Or inVariant <> 3 Then +If inLong <> 1 Or inFloat <> 2 Or inVariant <> "4" Then runtest = -1 Exit Function End If @@ -365,7 +366,7 @@ inVariant = 0 inVariant = 0 obj.defaultvalue1(inLong, inFloat) obj.defaultvalue2(inLong, inFloat, inVariant) -If inLong <> inLong2 Or inFloat <> inFloat2 Or inVariant <> 3 Then +If inLong <> inLong2 Or inFloat <> inFloat2 Or inVariant <> "4" Then runtest = -1 Exit Function End If diff --git a/extensions/test/ole/StarBasic_OleClient/readme.txt b/extensions/test/ole/StarBasic_OleClient/readme.txt index 8e129dddddcd..2eca8aac3272 100644 --- a/extensions/test/ole/StarBasic_OleClient/readme.txt +++ b/extensions/test/ole/StarBasic_OleClient/readme.txt @@ -1,10 +1,10 @@ -oleclient.bas is a StarBasic script that uses the -"com.sun.star.bridge.OleObjectFactory" service to instantiate -the ActiveX component "AxTestComponents.Basic" and calls -functions on it. - ------------------------------------------------------------- -Requirements: - -ActiveX component: AxTestComponent.Basic must be registered. -It is contained in extensions/test/ole/AxTestComponents \ No newline at end of file +oleclient.bas is a StarBasic script that uses the +"com.sun.star.bridge.OleObjectFactory" service to instantiate +the ActiveX component "AxTestComponents.Basic" and calls +functions on it. + +------------------------------------------------------------ +Requirements: + +ActiveX component: AxTestComponent.Basic must be registered. +It is contained in extensions/test/ole/AxTestComponents diff --git a/extensions/test/ole/VisualBasic/AssemblyInfo.vb b/extensions/test/ole/VisualBasic/AssemblyInfo.vb new file mode 100644 index 000000000000..e663aa549ebe --- /dev/null +++ b/extensions/test/ole/VisualBasic/AssemblyInfo.vb @@ -0,0 +1,33 @@ +Imports System.Reflection +Imports System.Runtime.CompilerServices +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + +' TODO: Review the values of the assembly attributes + + + + + + + + + + +' Version information for an assembly consists of the following four values: + +' Major version +' Minor Version +' Build Number +' Revision + +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: + + + + diff --git a/extensions/test/ole/VisualBasic/Form1.frm b/extensions/test/ole/VisualBasic/Form1.frm deleted file mode 100644 index c2ed1f6a11f5..000000000000 --- a/extensions/test/ole/VisualBasic/Form1.frm +++ /dev/null @@ -1,349 +0,0 @@ -VERSION 5.00 -Begin VB.Form Form1 - Caption = "Form1" - ClientHeight = 4572 - ClientLeft = 48 - ClientTop = 336 - ClientWidth = 8460 - LinkTopic = "Form1" - ScaleHeight = 4572 - ScaleWidth = 8460 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton ctrInParamStart - Caption = "Start" - Height = 252 - Left = 240 - TabIndex = 20 - Top = 480 - Width = 732 - End - Begin VB.TextBox tareaResult - Height = 1932 - Left = 4920 - TabIndex = 19 - Top = 480 - Width = 3372 - End - Begin VB.CommandButton Command20 - Caption = "Command20" - Height = 252 - Left = 3000 - TabIndex = 18 - Top = 2640 - Width = 492 - End - Begin VB.CommandButton Command19 - Caption = "string" - Height = 252 - Left = 2280 - TabIndex = 17 - Top = 2640 - Width = 492 - End - Begin VB.CommandButton Command18 - Caption = "long" - Height = 252 - Left = 1560 - TabIndex = 16 - Top = 2640 - Width = 492 - End - Begin VB.CommandButton Command17 - Caption = "short" - Height = 252 - Left = 840 - TabIndex = 15 - Top = 2640 - Width = 492 - End - Begin VB.CommandButton Command16 - Caption = "byte" - Height = 252 - Left = 120 - TabIndex = 14 - Top = 2640 - Width = 492 - End - Begin VB.CommandButton Command15 - Caption = "array" - Height = 252 - Left = 3000 - TabIndex = 12 - Top = 1920 - Width = 612 - End - Begin VB.CommandButton Command14 - Caption = "string" - Height = 252 - Left = 2280 - TabIndex = 11 - Top = 1920 - Width = 492 - End - Begin VB.CommandButton Command13 - Caption = "long" - Height = 252 - Left = 1440 - TabIndex = 10 - Top = 1920 - Width = 612 - End - Begin VB.CommandButton Command12 - Caption = "short" - Height = 252 - Left = 720 - TabIndex = 9 - Top = 1920 - Width = 612 - End - Begin VB.CommandButton Command11 - Caption = "byte" - Height = 252 - Left = 120 - TabIndex = 8 - Top = 1920 - Width = 492 - End - Begin VB.CommandButton Command10 - Caption = "array" - Height = 252 - Left = 3000 - TabIndex = 6 - Top = 1200 - Width = 612 - End - Begin VB.CommandButton Command9 - Caption = "string" - Height = 252 - Left = 2280 - TabIndex = 5 - Top = 1200 - Width = 612 - End - Begin VB.CommandButton Command8 - Caption = "long" - Height = 252 - Left = 1560 - TabIndex = 4 - Top = 1200 - Width = 612 - End - Begin VB.CommandButton Command7 - Caption = "short" - Height = 252 - Left = 840 - TabIndex = 3 - Top = 1200 - Width = 612 - End - Begin VB.CommandButton Command6 - Caption = "byte" - Height = 252 - Left = 120 - TabIndex = 2 - Top = 1200 - Width = 612 - End - Begin VB.Label Label4 - Caption = "Properties" - Height = 252 - Left = 120 - TabIndex = 13 - Top = 2280 - Width = 1212 - End - Begin VB.Label Label3 - Caption = "In Out Parameter" - Height = 252 - Left = 120 - TabIndex = 7 - Top = 1560 - Width = 1332 - End - Begin VB.Label Label2 - Caption = "Out Parameter" - Height = 252 - Left = 120 - TabIndex = 1 - Top = 840 - Width = 1332 - End - Begin VB.Label Label1 - Caption = "In Parameter" - Height = 252 - Left = 240 - TabIndex = 0 - Top = 120 - Width = 1212 - End -End -Attribute VB_Name = "Form1" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit -Private objServiceManager -Private objCoreReflection -Private objOleTest - -Private Sub ctrInParamStart_Click() -Dim ret As Variant - -' In Parameter, simple types -'============================================ -ret = objOleTest.in_methodByte(10) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodFloat(3.14) -Debug.Print TypeName(ret) & " " & CStr(ret) - -Dim d As Double 'try conversion -d = 3.14 -ret = objOleTest.in_methodFloat(3.14) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodDouble(4.14) -Debug.Print TypeName(ret) & " " & CStr(ret) -Dim s As Single -s = 4.14 -ret = objOleTest.in_methodDouble(s) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodBool(True) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodBool(False) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodShort(-10) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodUShort(10) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodLong(-1000000) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodULong(1000000) -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodString("This is a String") -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodChar("A") -Debug.Print TypeName(ret) & " " & CStr(ret) -ret = objOleTest.in_methodAny("This is a String in an any") -Debug.Print TypeName(ret) & " " & CStr(ret) - -Call objOleTest.in_methodAll(10, 10.1, 10.111, True, 10, 11, 12, 13, _ - "A String", "A", "A String in an Any") - -'Out Parameter simple types -'================================================ -Dim outByte As Byte -objOleTest.testout_methodByte outByte -Debug.Print "out byte " & CStr(outByte) -Dim outFloat As Single -objOleTest.testout_methodFloat outFloat -Debug.Print "out float " & CStr(outFloat) -Dim outDouble As Double -objOleTest.testout_methodDouble outDouble -Debug.Print "out double " & CStr(outDouble) -Dim outBool As Boolean -objOleTest.testout_methodBool outBool -Debug.Print "out bool " & CStr(outBool) -Dim outInt As Integer -objOleTest.testout_methodShort outInt -Debug.Print "out short " & CStr(outInt) -objOleTest.testout_methodUShort outInt -Debug.Print "out unsignedshort " & CStr(outInt) -Dim outLong As Long -objOleTest.testout_methodLong outLong -Debug.Print "out long " & CStr(outInt) -objOleTest.testout_methodULong outLong -Debug.Print "out unsigned long " & CStr(outInt) -Dim outString As String -objOleTest.testout_methodString outString -Debug.Print "out string " & CStr(outString) -Dim outChar As Integer -objOleTest.testout_methodChar outChar -Debug.Print "out char " & CStr(outChar) -Dim outCharS As String -objOleTest.testout_methodChar outCharS -Debug.Print "out char (String) " & CStr(outCharS) -objOleTest.testout_methodAny outString -Debug.Print "out Any " & CStr(outString) -'Out Parameter simple types (VARIANT var) -Dim outVar As Variant -objOleTest.testout_methodByte outVar -Debug.Print "out Byte (VARIANT) " & CStr(outVar) -objOleTest.testout_methodFloat outVar -Debug.Print "out float (VARIANT) " & CStr(outVar) -objOleTest.testout_methodDouble outVar -Debug.Print "out double (VARIANT) " & CStr(outVar) -objOleTest.testout_methodBool outVar -Debug.Print "out bool (VARIANT) " & CStr(outVar) -objOleTest.testout_methodShort outVar -Debug.Print "out short (VARIANT) " & CStr(outVar) -objOleTest.testout_methodUShort outVar -Debug.Print "out unsigned short (VARIANT) " & CStr(outVar) -objOleTest.testout_methodLong outVar -Debug.Print "out long (VARIANT) " & CStr(outVar) -objOleTest.testout_methodULong outVar -Debug.Print "out unsigned long (VARIANT) " & CStr(outVar) -objOleTest.testout_methodString outVar -Debug.Print "out string (VARIANT) " & CStr(outVar) -objOleTest.testout_methodChar outVar -Debug.Print "out char (VARIANT) " & CStr(outVar) -objOleTest.testout_methodAny outVar -Debug.Print "out any (VARIANT) " & CStr(outVar) - -'In/Out simple types -outByte = 10 -objOleTest.testinout_methodByte outByte -Debug.Print "inout byte " & CStr(outByte) -outFloat = 3.14 -objOleTest.testinout_methodFloat outFloat -Debug.Print "inout float " & CStr(outFloat) -outDouble = 4.14 -objOleTest.testinout_methodDouble outDouble -Debug.Print "inout double " & CStr(outDouble) -outBool = True -objOleTest.testinout_methodBool outBool -Debug.Print "inout bool " & CStr(outBool) -outInt = 10 -objOleTest.testinout_methodShort outInt -Debug.Print "inout short " & CStr(outInt) -outInt = 20 -objOleTest.testinout_methodUShort outInt -Debug.Print "inout unsignedshort " & CStr(outInt) -outLong = 30 -objOleTest.testinout_methodLong outLong -Debug.Print "inout long " & CStr(outLong) -outLong = 40 -objOleTest.testinout_methodULong outLong -Debug.Print "inout unsigned long " & CStr(outLong) -outString = "this is an in string" -objOleTest.testinout_methodString outString -Debug.Print "inout string " & CStr(outString) - -outString = "this is an in String" -objOleTest.testout_methodChar outString -Debug.Print "out char " & CStr(outString) -outString = "this is another in out string" -objOleTest.testout_methodAny outString -Debug.Print "out Any " & CStr(outString) - - - - - -Dim var As Boolean -var = True -Debug.Print CStr(var) - - -End Sub - -Private Sub Form_Load() - Set objServiceManager = CreateObject("com.sun.star.ServiceManager") - Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") - - Set objOleTest = objServiceManager.createInstance("oletest.OleTest") - Debug.Print TypeName(objOleTest) -End Sub - -Private Sub Text1_Change() - -End Sub diff --git a/extensions/test/ole/VisualBasic/Module1.bas b/extensions/test/ole/VisualBasic/Module1.bas deleted file mode 100644 index ea33fdd06516..000000000000 --- a/extensions/test/ole/VisualBasic/Module1.bas +++ /dev/null @@ -1,858 +0,0 @@ -Attribute VB_Name = "Module1" -Option Explicit - -Private objServiceManager -Private objCoreReflection -Private objOleTest -Private objEventListener -'General counter -Dim i As Long -Dim j As Long -Dim sError As String -Dim inHyper As Variant, outHyper As Variant, retHyper As Variant - -Sub Main() - Set objServiceManager = CreateObject("com.sun.star.ServiceManager") - Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") - ' extensions/test/ole/cpnt - Set objOleTest = objServiceManager.createInstance("oletest.OleTest") - ' extensions/test/ole/EventListenerSample/VBEventListener - Set objEventListener = CreateObject("VBasicEventListener.VBEventListener") - Debug.Print TypeName(objOleTest) - - -'testBasics -'testHyper -'testAny -'testObjects -'testGetStruct -'testImplementedInterfaces -'testGetValueObject -'testArrays -testProps - -End Sub -Function testProps() - - - Dim aToolbarItemProp1 As Object - Set aToolbarItemProp1 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") - Dim aToolbarItemProp2 As Object - Set aToolbarItemProp2 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") - Dim aToolbarItemProp3 As Object - Set aToolbarItemProp3 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") - Dim properties(2) As Object - - aToolbarItemProp1.Name = "CommandURL" - aToolbarItemProp1.Value = "macro:///standard.module1.TestIt" - aToolbarItemProp2.Name = "Label" - aToolbarItemProp2.Value = "Test" - aToolbarItemProp3.Name = "Type" - aToolbarItemProp3.Value = 0 - - Set properties(0) = aToolbarItemProp1 - Set properties(1) = aToolbarItemProp2 - Set properties(2) = aToolbarItemProp3 - - - Dim dummy() - 'Dim objDummy As Object = New Object - 'dummy = System.Array.createInstance(objDummy.GetType, 0) - Dim Desktop As Object - Set Desktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") - Dim Doc As Object - Set Doc = Desktop.loadComponentFromURL("private:factory/swriter", "_blank", 2, dummy) - Dim LayoutManager As Object - Set LayoutManager = Doc.currentController.Frame.LayoutManager - - LayoutManager.createElement ("private:resource/toolbar/user_toolbar1") - LayoutManager.showElement ("private:resource/toolbar/user_toolbar1") - Dim ToolBar As Object - Set ToolBar = LayoutManager.getElement("private:resource/toolbar/user_toolbar1") - Dim settings As Object - Set settings = ToolBar.getSettings(True) - -'the changes are here: - Dim aany As Object - Set aany = objServiceManager.Bridge_GetValueObject() - Call aany.Set("[]com.sun.star.beans.PropertyValue", properties) - Call settings.insertByIndex(0, aany) - Call ToolBar.setSettings(settings) - - -End Function - - -Function testBasics() -' In Parameter, simple types -'============================================ -Dim tmpVar As Variant -Dim ret As Variant -Dim inByte As Byte, outByte As Byte, retByte As Byte -Dim inBool As Boolean, outBool As Boolean, retBool As Boolean -Dim inShort As Integer, outShort As Integer, retShort As Integer -Dim inUShort As Integer, outUShort As Integer, retUShort As Integer -Dim inLong As Long, outLong As Long, retLong As Long -Dim inULong As Long, outULong As Long, retULong As Long -Dim inHyper As Variant, outHyper As Variant, retHyper As Variant -Dim inUHyper As Variant, outUHyper As Variant, retUHyper As Variant -Dim inFloat As Single, outFloat As Single, retFloat As Single -Dim inDouble As Double, outDouble As Double, retDouble As Double -Dim inString As String, outString As String, retString As String -Dim inChar As Integer, outChar As Integer, retChar As Integer, retChar2 As Integer -Dim inCharAsString As String, outCharAsString As String, retCharAsString As String -Dim inAny As Variant, outAny As Variant, retAny As Variant -Dim inType As Object, outType As Object, retType As Object -Dim inXInterface As Object, outXInterface As Object, retXInterface As Object -Dim inXInterface2 As Object, outXInterface2 As Object, retXInterface2 As Object - - -Dim outVarByte As Variant -Dim outVarBool As Variant -Dim outVarShort As Variant -Dim outVarUShort As Variant -Dim outVarLong As Variant -Dim outVarULong As Variant -Dim outVarFloat As Variant -Dim outVarDouble As Variant -Dim outVarString As Variant -Dim outVarChar As Variant -Dim outVarAny As Variant -Dim outVarType As Variant - -inByte = 10 -inBool = True -inShort = -10 -inUShort = -100 -inLong = -1000 -inHyper = CDec("-9223372036854775808") 'lowest int64 -inUHyper = CDec("18446744073709551615") ' highest unsigned int64 -inULong = 10000 -inFloat = 3.14 -inDouble = 3.14 -inString = "Hello World!" -inChar = 65 -inCharAsString = "A" -inAny = "Hello World" -Set inType = objServiceManager.Bridge_CreateType("[]long") -Set inXInterface = objCoreReflection -Set inXInterface2 = objEventListener - -retByte = objOleTest.in_methodByte(inByte) -retBool = objOleTest.in_methodBool(inBool) -retShort = objOleTest.in_methodShort(inShort) -retUShort = objOleTest.in_methodUShort(inUShort) -retLong = objOleTest.in_methodLong(inLong) -retULong = objOleTest.in_methodULong(inULong) -retHyper = objOleTest.in_methodHyper(inHyper) -retUHyper = objOleTest.in_methodUHyper(inUHyper) -retFloat = objOleTest.in_methodFloat(inFloat) -retDouble = objOleTest.in_methodDouble(inDouble) -retString = objOleTest.in_methodString(inString) -retChar = objOleTest.in_methodChar(inChar) -retChar2 = objOleTest.in_methodChar(inCharAsString) -retAny = objOleTest.in_methodAny(inAny) -Set retType = objOleTest.in_methodType(inType) -Set retXInterface = objOleTest.in_methodXInterface(inXInterface) ' UNO object -Set retXInterface2 = objOleTest.in_methodXInterface(inXInterface2) - -If retByte <> inByte Or retBool <> inBool _ - Or retShort <> inShort Or retUShort <> inUShort _ - Or retLong <> inLong Or retULong <> inULong _ - Or retHyper <> inHyper Or retUHyper <> inUHyper _ - Or retFloat <> inFloat Or retDouble <> inDouble _ - Or retString <> inString Or retChar <> inChar _ - Or retChar2 <> Asc(inCharAsString) Or retAny <> inAny _ - Or retType <> inType _ - Or Not (inXInterface Is retXInterface) _ - Or Not (inXInterface2 Is retXInterface2) Then - sError = "in - parameter and return value test failed" - MsgBox sError - -End If - -'Out Parameter simple types -'================================================ - -objOleTest.testout_methodByte outByte -objOleTest.testout_methodFloat outFloat -objOleTest.testout_methodDouble outDouble -objOleTest.testout_methodBool outBool -objOleTest.testout_methodShort outShort -objOleTest.testout_methodUShort outUShort -objOleTest.testout_methodLong outLong -objOleTest.testout_methodULong outULong -objOleTest.testout_methodHyper outHyper -objOleTest.testout_methodUHyper outUHyper -objOleTest.testout_methodString outString -objOleTest.testout_methodChar outChar -objOleTest.testout_methodChar outCharAsString -objOleTest.testout_methodAny outAny -objOleTest.testout_methodType outType -'objOleTest.in_methodXInterface (inXInterface) ' UNO object -Call objOleTest.in_methodXInterface(inXInterface) ' UNO object -objOleTest.testout_methodXInterface outXInterface -Call objOleTest.in_methodXInterface(inXInterface2) ' COM object -objOleTest.testout_methodXInterface outXInterface2 - - -If outByte <> inByte Or outFloat <> inFloat _ - Or outDouble <> inDouble Or outBool <> inBool _ - Or outShort <> inShort Or outUShort <> inUShort _ - Or outLong <> inLong Or outULong <> inULong _ - Or outHyper <> inHyper Or outUHyper <> inUHyper _ - Or outString <> inString Or outChar <> inChar _ - Or outCharAsString <> inCharAsString _ - Or outAny <> inAny Or outType <> inType _ - Or Not (inXInterface Is outXInterface) _ - Or Not (inXInterface2 Is outXInterface2) Then - - sError = "out - parameter test failed!" - MsgBox sError -End If - -'Out Parameter simple types (VARIANT var) -'==================================================== -objOleTest.testout_methodByte outVarByte -objOleTest.testout_methodBool outVarBool -objOleTest.testout_methodChar outVarChar -objOleTest.testout_methodShort outVarShort -objOleTest.testout_methodUShort outVarUShort -objOleTest.testout_methodLong outVarLong -objOleTest.testout_methodULong outVarULong -objOleTest.testout_methodString outVarString -objOleTest.testout_methodFloat outVarFloat -objOleTest.testout_methodDouble outVarDouble -objOleTest.testout_methodAny outVarAny -objOleTest.testout_methodType outVarType - -If outVarByte <> inByte Or outVarBool <> inBool _ - Or outVarChar <> inChar _ - Or outVarShort <> inShort Or outVarUShort <> inUShort _ - Or outVarLong <> inLong Or outVarULong <> inULong _ - Or outVarString <> inString _ - Or outVarFloat <> inFloat Or outVarDouble <> inDouble _ - Or outVarAny <> inAny _ - Or outVarType <> inType _ - Then - sError = "out - parameter (VARIANT) test failed!" - MsgBox sError -End If - -'In/Out simple types -'============================================ -objOleTest.in_methodByte (0) -objOleTest.in_methodBool (False) -objOleTest.in_methodShort (0) -objOleTest.in_methodUShort (0) -objOleTest.in_methodLong (0) -objOleTest.in_methodULong (0) -objOleTest.in_methodHyper (0) -objOleTest.in_methodUHyper (0) -objOleTest.in_methodFloat (0) -objOleTest.in_methodDouble (0) -objOleTest.in_methodString (0) -objOleTest.in_methodChar (0) -objOleTest.in_methodAny (0) -objOleTest.in_methodType (objServiceManager.Bridge_CreateType("boolean")) -Set outXInterface = Nothing -Call objOleTest.in_methodXInterface(outXInterface) - - -outByte = 10 -retByte = outByte -objOleTest.testinout_methodByte retByte -objOleTest.testinout_methodByte retByte -outBool = True -retBool = outBool -objOleTest.testinout_methodBool retBool -objOleTest.testinout_methodBool retBool -outShort = 10 -retShort = outShort -objOleTest.testinout_methodShort retShort -objOleTest.testinout_methodShort retShort -outUShort = 20 -retUShort = outUShort -objOleTest.testinout_methodUShort retUShort -objOleTest.testinout_methodUShort retUShort -outLong = 30 -retLong = outLong -objOleTest.testinout_methodLong retLong -objOleTest.testinout_methodLong retLong -outULong = 40 -retULong = outULong -objOleTest.testinout_methodULong retLong -objOleTest.testinout_methodULong retLong -outHyper = CDec("9223372036854775807") 'highest positiv value of int64 -retHyper = outHyper -objOleTest.testinout_methodHyper retHyper -objOleTest.testinout_methodHyper retHyper -outUHyper = CDec("18446744073709551615") 'highest value of unsigned int64 -retUHyper = outUHyper -objOleTest.testinout_methodUHyper retUHyper -objOleTest.testinout_methodUHyper retUHyper -outFloat = 3.14 -retFloat = outFloat -objOleTest.testinout_methodFloat retFloat -objOleTest.testinout_methodFloat retFloat -outDouble = 4.14 -retDouble = outDouble -objOleTest.testinout_methodDouble retDouble -objOleTest.testinout_methodDouble retDouble -outString = "Hello World!" -retString = outString -objOleTest.testinout_methodString retString -objOleTest.testinout_methodString retString -outChar = 66 -retChar = outChar -objOleTest.testinout_methodChar retChar -objOleTest.testinout_methodChar retChar -outCharAsString = "H" -retCharAsString = outCharAsString -objOleTest.testinout_methodChar retCharAsString -objOleTest.testinout_methodChar retCharAsString -outAny = "Hello World 2!" -retAny = outAny -objOleTest.testinout_methodAny retAny -objOleTest.testinout_methodAny retAny -Set outType = objServiceManager.Bridge_CreateType("long") -Set retType = outType -objOleTest.testinout_methodType retType -objOleTest.testinout_methodType retType - -Set outXInterface = objCoreReflection -Set retXInterface = outXInterface -objOleTest.testinout_methodXInterface2 retXInterface - -If outByte <> retByte Or outBool <> retBool _ - Or outShort <> retShort Or outUShort <> retUShort _ - Or outLong <> retLong Or outULong <> retULong _ - Or outHyper <> retHyper Or outUHyper <> outUHyper _ - Or outFloat <> retFloat _ - Or outDouble <> retDouble _ - Or outString <> retString Or outChar <> retChar _ - Or outCharAsString <> retCharAsString Or outAny <> retAny _ - Or outType <> retType _ - Or Not (outXInterface Is retXInterface) Then - sError = "in/out - parameter test failed!" - MsgBox sError -End If - -'Attributes -objOleTest.AByte = inByte -retByte = 0 -retByte = objOleTest.AByte -objOleTest.AFloat = inFloat -retFloat = 0 -retFloat = objOleTest.AFloat -objOleTest.AType = inType -Set retType = Nothing -Set retType = objOleTest.AType - -If inByte <> retByte _ - Or inFloat <> retFloat _ - Or inType <> retType _ - Then - sError = "Attributes - test failed!" - MsgBox sError -End If - -End Function -Function testHyper() - -'====================================================================== -' Other Hyper tests -Dim emptyVar As Variant -Dim retAny As Variant - -retAny = emptyVar -inHyper = CDec("9223372036854775807") 'highest positiv value of int64 -retAny = objOleTest.in_methodAny(inHyper) -sError = "hyper test failed" -If inHyper <> retAny Then - MsgBox sError -End If -inHyper = CDec("-9223372036854775808") 'lowest negativ value of int64 -retAny = objOleTest.in_methodAny(inHyper) -If inHyper <> retAny Then - MsgBox sError -End If -inHyper = CDec("18446744073709551615") 'highest positiv value of unsigne int64 -retAny = objOleTest.in_methodAny(inHyper) -If inHyper <> retAny Then - MsgBox sError -End If -inHyper = CDec(-1) -retAny = objOleTest.in_methodAny(inHyper) -If inHyper <> retAny Then - MsgBox sError -End If -inHyper = CDec(0) -retAny = objOleTest.in_methodAny(inHyper) -If inHyper <> retAny Then - MsgBox sError -End If - -'============================================================================== - - -End Function -Function testAny() -Dim outVAr - -'Any test. We pass in an any as value object. If it is not correct converted -'then the target component throws a RuntimeException -Dim lengthInAny As Long - -lengthInAny = 10 -Dim seqLongInAny(10) As Long -For i = 0 To lengthInAny - 1 - seqLongInAny(i) = i + 10 -Next -Dim anySeqLong As Object -Set anySeqLong = objOleTest.Bridge_GetValueObject() -anySeqLong.Set "[]long", seqLongInAny -Dim anySeqRet As Variant -Err.Clear -On Error Resume Next -anySeqRet = objOleTest.other_methodAny(anySeqLong, "[]long") - -If Err.Number <> 0 Then - MsgBox "error" -End If -End Function - -Function testObjects() -' COM obj -Dim outVAr -Dim retObj As Object -'OleTest receives a COM object that implements XEventListener -'OleTest then calls a disposing on the object. The object then will be -'asked if it has been called -objEventListener.setQuiet True -objEventListener.resetDisposing -Set retObj = objOleTest.in_methodInvocation(objEventListener) -Dim ret -ret = objEventListener.disposingCalled -If ret = False Then - MsgBox "Error" -End If - -'The returned object should be objEventListener, test it by calling disposing -' takes an IDispatch as Param ( EventObject).To provide a TypeMismatch -'we put in another IDispatch -retObj.resetDisposing -retObj.disposing objEventListener -If retObj.disposingCalled = False Then - MsgBox "Error" -End If - -' out param gives out the OleTestComponent -'objOleTest.testout_methodXInterface retObj -'outVAr = Null -'retObj.testout_methodAny outVAr -'Debug.Print "test out Interface " & CStr(outVAr) -'If outVAr <> "I am a string in an any" Then -' MsgBox "error" -'End If - - -'in out -' in: UNO object, the same is expected as out param -' the function expects OleTest as parameter and sets a value - -Dim myAny As Variant - - - -Dim objOleTest2 As Object -Set objOleTest2 = objServiceManager.createInstance("oletest.OleTest") -'Set a value -objOleTest2.AttrAny2 = "VBString " - -'testinout_methodXInterfaces substitutes the argument with the object set in in_methodXInterface -objOleTest.AttrAny2 = "VBString this string was written in the UNO component to the inout pararmeter" -objOleTest.in_methodXInterface objOleTest -objOleTest.testinout_methodXInterface2 objOleTest2 -Dim tmpVar As Variant -tmpVar = Null -tmpVar = objOleTest2.AttrAny2 -Debug.Print "in: Uno out: the same object // " & CStr(tmpVar) -If tmpVar <> "VBString this string was written in the UNO component to the inout pararmeter" Then - MsgBox "error" -End If - - -'create a struct -Dim structClass As Object -Set structClass = objCoreReflection.forName("oletest.SimpleStruct") -Dim structInstance As Object -structClass.CreateObject structInstance -structInstance.message = "Now we are in VB" -Debug.Print "struct out " & structInstance.message -If structInstance.message <> "Now we are in VB" Then - MsgBox "error" -End If - -'put the struct into OleTest. The same struct will be returned with an added String -Dim structRet As Object -Set structRet = objOleTest.in_methodStruct(structInstance) -Debug.Print "struct in - return " & structRet.message -If structRet.message <> "Now we are in VBThis string was set in OleTest" Then - MsgBox "error" -End If - - -End Function -Function testGetStruct() -'Bridge_GetStruct -'======================================================== -Dim objDocument As Object -Set objDocument = createHiddenDocument() -objDocument.dispose -End Function - -Function testImplementedInterfaces() -'Bridge_ImplementedInterfaces -'================================================= -' call an UNO function that takes an XEventListener interface -'We provide a COM implementation (IDispatch) as EventListener -'Open a new empty writer document - -Dim objDocument As Object -Set objDocument = createHiddenDocument() -objEventListener.resetDisposing -objDocument.addEventListener objEventListener -objDocument.dispose -If objEventListener.disposingCalled = False Then - MsgBox "Error" -End If -End Function - -Function testGetValueObject() -'Bridge_GetValueObject -'================================================== -Dim objVal As Object -Set objVal = objOleTest.Bridge_GetValueObject() -Dim arrByte(9) As Byte -Dim countvar As Long -For countvar = 0 To 9 - arrByte(countvar) = countvar -Next countvar - -objVal.Set "[]byte", arrByte -Dim ret -ret = 0 -ret = objOleTest.methodByte(objVal) -'Test if ret is the same array - -Dim key -key = 0 -For Each key In ret - If ret(key) <> arrByte(key) Then - MsgBox "Error" - End If - Debug.Print ret(key) -Next key - -Dim outByte As Byte -outByte = 77 -Dim retByte As Byte -retByte = outByte -objVal.InitInOutParam "byte", retByte -objOleTest.testinout_methodByte objVal -objVal.InitInOutParam "byte", retByte -objOleTest.testinout_methodByte objVal - -ret = 0 -ret = objVal.Get() -Debug.Print ret -If ret <> outByte Then - MsgBox "error" -End If - -objVal.InitOutParam -Dim inChar As Integer -inChar = 65 -objOleTest.in_methodChar (inChar) -objOleTest.testout_methodChar objVal 'Returns 'A' (65) -ret = 0 -ret = objVal.Get() -Debug.Print ret -If ret <> inChar Then - MsgBox "error" -End If - -End Function - -Function testArrays() -'Arrays -'======================================== -Dim arrLong(2) As Long -Dim arrObj(2) As Object -Dim countvar As Long -For countvar = 0 To 2 - arrLong(countvar) = countvar + 10 - Debug.Print countvar - Set arrObj(countvar) = CreateObject("VBasicEventListener.VBEventListener") - arrObj(countvar).setQuiet True -Next - -'Arrays always contain VARIANTS -Dim seq() As Variant -seq = objOleTest.methodLong(arrLong) - -For countvar = 0 To 2 - Debug.Print CStr(seq(countvar)) - If arrLong(countvar) <> seq(countvar) Then - MsgBox "error" - End If -Next -seq = objOleTest.methodXInterface(arrObj) -For countvar = 0 To 2 - Dim tmp As Object - seq(countvar).resetDisposing - seq(countvar).disposing tmp - If seq(countvar).disposingCalled = False Then - MsgBox "Error" - End If -Next - -'Array containing interfaces (element type is VT_DISPATCH) -Dim arEventListener(2) As Object -For countvar = 0 To 2 - Set arEventListener(countvar) = CreateObject("VBasicEventListener.VBEventListener") - arEventListener(countvar).setQuiet True -Next - -'The function calls disposing on the listeners -seq = objOleTest.methodXEventListeners(arEventListener) -Dim count -For countvar = 0 To 2 - If arEventListener(countvar).disposingCalled = False Then - MsgBox "Error" - End If -Next -'Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH -Dim arEventListener2(2) As Variant -For countvar = 0 To 2 - Set arEventListener2(countvar) = CreateObject("VBasicEventListener.VBEventListener") - arEventListener2(countvar).setQuiet True -Next -seq = objOleTest.methodXEventListeners(arEventListener2) -For countvar = 0 To 2 - If arEventListener2(countvar).disposingCalled = False Then - MsgBox "Error" - End If -Next - -'Variant containing Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH -Dim arEventListener3(2) As Variant -For countvar = 0 To 2 - Dim var As Variant - Set arEventListener3(countvar) = CreateObject("VBasicEventListener.VBEventListener") - arEventListener3(countvar).setQuiet True -Next -Dim varContAr As Variant -varContAr = arEventListener3 -seq = objOleTest.methodXEventListeners(varContAr) -For countvar = 0 To 2 - If arEventListener3(countvar).disposingCalled = False Then - MsgBox "Error" - End If -Next - -'Get a sequence created in UNO, out param is Variant ( VT_BYREF|VT_VARIANT) -Dim seqX As Variant - -objOleTest.testout_methodSequence seqX -Dim key -For Each key In seqX - Debug.Print CStr(seqX(key)) - If seqX(key) <> key Then - MsgBox "error" - End If -Next -'Get a sequence created in UNO, out param is array Variant ( VT_BYREF|VT_VARIANT|VT_ARRAY) -Dim seqX2() As Variant -objOleTest.testout_methodSequence seqX2 - -For Each key In seqX2 - Debug.Print CStr(seqX2(key)) -Next - -'pass it to UNO and get it back -Dim seq7() As Variant -seq7 = objOleTest.methodLong(seqX) -Dim key2 -For Each key2 In seq7 - Debug.Print CStr(seq7(key2)) - If seqX2(key) <> key Then - MsgBox "error" - End If -Next - -'array with starting index != 0 -Dim seqIndex(1 To 2) As Long -Dim seq8() As Variant -Dim longVal1 As Long, longVal2 As Long -longVal1 = 1 -longVal2 = 2 -seqIndex(1) = longVal1 -seqIndex(2) = longVal2 -seq8 = objOleTest.methodLong(seqIndex) -If longVal1 <> seq8(0) And longVal2 <> seq8(1) Then - MsgBox "error" -End If - - -'in out Array -' arrLong is Long Array -Dim inoutVar(2) As Variant - -For countvar = 0 To 2 - inoutVar(countvar) = countvar + 10 -Next - -objOleTest.testinout_methodSequence inoutVar - -countvar = 0 -For countvar = 0 To 2 - Debug.Print CStr(inoutVar(countvar)) - If inoutVar(countvar) <> countvar + 11 Then - MsgBox "error" - End If -Next - -'Multidimensional array -'============================================================ -' Sequence< Sequence > methodSequence( Sequence< Sequence long> >) -' Real multidimensional array Array -' 9 is Dim 1 (least significant) with C API -Dim mulAr(9, 1) As Long -For i = 0 To 1 - For j = 0 To 9 - mulAr(j, i) = i * 10 + j - Next j -Next i - -Dim resMul As Variant -resMul = objOleTest.methodSequence(mulAr) - -Dim countDim1 As Long -Dim countDim2 As Long -For countDim2 = 0 To 1 - Dim arr - arr = resMul(countDim2) - For countDim1 = 0 To 9 - Debug.Print arr(countDim1) - If arr(countDim1) <> mulAr(countDim1, countDim2) Then - MsgBox "Error Multidimensional Array" - End If - Next countDim1 -Next countDim2 -IsArray (resMul) - -'Array of VARIANTs containing arrays -Dim mulAr2(1) As Variant -Dim arr2(9) As Long -For i = 0 To 1 - ' Dim arr(9) As Long - For j = 0 To 9 - arr2(j) = i * 10 + j - Next j - mulAr2(i) = arr2 -Next i - -resMul = 0 -resMul = objOleTest.methodSequence(mulAr2) -arr = 0 -Dim tmpVar As Variant -For countDim2 = 0 To 1 - arr = resMul(countDim2) - tmpVar = mulAr2(countDim2) - For countDim1 = 0 To 9 - Debug.Print arr(countDim1) - If arr(countDim1) <> tmpVar(countDim1) Then - MsgBox "Error Multidimensional Array" - End If - Next countDim1 -Next countDim2 - -'Array containing interfaces (element type is VT_DISPATCH) -Dim arArEventListener(1, 2) As Object -For i = 0 To 1 - For j = 0 To 2 - Set arArEventListener(i, j) = CreateObject("VBasicEventListener.VBEventListener") - arArEventListener(i, j).setQuiet True - Next -Next -'The function calls disposing on the listeners -seq = objOleTest.methodXEventListenersMul(arArEventListener) -For i = 0 To 1 - For j = 0 To 2 - If arArEventListener(i, j).disposingCalled = False Then - MsgBox "Error" - End If - Next -Next - -'Array containing interfaces (element type is VT_VARIANT containing VT_DISPATCH) -Dim arArEventListener2(1, 2) As Variant -For i = 0 To 1 - For j = 0 To 2 - Set arArEventListener2(i, j) = CreateObject("VBasicEventListener.VBEventListener") - arArEventListener2(i, j).setQuiet True - Next -Next -'The function calls disposing on the listeners -seq = objOleTest.methodXEventListenersMul(arArEventListener2) -For i = 0 To 1 - For j = 0 To 2 - If arArEventListener2(i, j).disposingCalled = False Then - MsgBox "Error" - End If - Next -Next - -' SAFEARRAY of VARIANTS containing SAFEARRAYs -'The ultimate element type is VT_DISPATCH ( XEventListener) -Dim arEventListener4(1) As Variant -Dim seq1(2) As Object -Dim seq2(2) As Object -For i = 0 To 2 - Set seq1(i) = CreateObject("VBasicEventListener.VBEventListener") - Set seq2(i) = CreateObject("VBasicEventListener.VBEventListener") - seq1(i).setQuiet True - seq2(i).setQuiet True -Next -arEventListener4(0) = seq1 -arEventListener4(1) = seq2 -'The function calls disposing on the listeners -seq = objOleTest.methodXEventListenersMul(arEventListener4) -For i = 0 To 2 - If seq1(i).disposingCalled = False Or seq2(i).disposingCalled = False Then - MsgBox "Error" - End If -Next - -End Function - -Function createHiddenDocument() -'Try to create a hidden document -Dim objPropValue -Set objPropValue = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") -'Set the members. If this fails then there is an Error -objPropValue.Name = "hidden" -objPropValue.Handle = -1 -objPropValue.Value = True - -'create a hidden document -'Create the Desktop -Dim objDesktop As Object -Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") -'Open a new empty writer document -Dim args(0) As Object -Set args(0) = objPropValue -Set createHiddenDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args()) -End Function diff --git a/extensions/test/ole/VisualBasic/Module1.vb b/extensions/test/ole/VisualBasic/Module1.vb new file mode 100644 index 000000000000..364af636585f --- /dev/null +++ b/extensions/test/ole/VisualBasic/Module1.vb @@ -0,0 +1,853 @@ +Option Strict Off +Option Explicit On +Module Module1 + +Private objServiceManager As Object +Private objCoreReflection As Object +Private objOleTest As Object +Private objEventListener As Object +'General counter +Dim i As Integer +Dim j As Integer +Dim sError As String +Dim outHyper, inHyper, retHyper As Object + +Public Sub Main() + objServiceManager = CreateObject("com.sun.star.ServiceManager") + objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") + ' extensions/test/ole/cpnt + objOleTest = objServiceManager.createInstance("oletest.OleTest") + ' extensions/test/ole/EventListenerSample/VBEventListener + objEventListener = CreateObject("VBasicEventListener.VBEventListener") + Debug.Print(TypeName(objOleTest)) + + + testBasics() + testHyper() + testAny() + testObjects() + testGetStruct() + ''dispose not working i103353 + 'testImplementedInterfaces() + testGetValueObject() + testArrays() + testProps() + + End Sub + Function testProps() As Object + + Dim aToolbarItemProp1 As Object + aToolbarItemProp1 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") + Dim aToolbarItemProp2 As Object + aToolbarItemProp2 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") + Dim aToolbarItemProp3 As Object + aToolbarItemProp3 = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") + Dim properties(2) As Object + + aToolbarItemProp1.Name = "CommandURL" + aToolbarItemProp1.Value = "macro:///standard.module1.TestIt" + aToolbarItemProp2.Name = "Label" + aToolbarItemProp2.Value = "Test" + aToolbarItemProp3.Name = "Type" + aToolbarItemProp3.Value = 0 + + properties(0) = aToolbarItemProp1 + properties(1) = aToolbarItemProp2 + properties(2) = aToolbarItemProp3 + + + Dim dummy(-1) As Object + + Dim Desktop As Object + Desktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") + Dim Doc As Object + Doc = Desktop.loadComponentFromURL("private:factory/swriter", "_blank", 2, dummy) + Dim LayoutManager As Object + LayoutManager = Doc.currentController.Frame.LayoutManager + + LayoutManager.createElement("private:resource/toolbar/user_toolbar1") + LayoutManager.showElement("private:resource/toolbar/user_toolbar1") + Dim ToolBar As Object + ToolBar = LayoutManager.getElement("private:resource/toolbar/user_toolbar1") + Dim settings As Object + settings = ToolBar.getSettings(True) + + 'the changes are here: + Dim aany As Object + aany = objServiceManager.Bridge_GetValueObject() + Call aany.Set("[]com.sun.star.beans.PropertyValue", properties) + Call settings.insertByIndex(0, aany) + Call ToolBar.setSettings(settings) + + + End Function + + + Function testBasics() As Object + ' In Parameter, simple types + '============================================ + Dim tmpVar As Object + Dim ret As Object + Dim outByte, inByte, retByte As Byte + Dim outBool, inBool, retBool As Boolean + Dim outShort, inShort, retShort As Short + Dim outUShort, inUShort, retUShort As Short + Dim outLong, inLong, retLong As Integer + Dim outULong, inULong, retULong As Integer + Dim outHyper, inHyper, retHyper As Object + Dim outUHyper, inUHyper, retUHyper As Object + Dim outFloat, inFloat, retFloat As Single + Dim outDouble, inDouble, retDouble As Double + Dim outString, inString, retString As String + Dim retChar, inChar, outChar, retChar2 As Short + Dim outCharAsString, inCharAsString, retCharAsString As String + Dim outAny, inAny, retAny As Object + Dim outType, inType, retType As Object + Dim outXInterface, inXInterface, retXInterface As Object + Dim outXInterface2, inXInterface2, retXInterface2 As Object + + + Dim outVarByte As Object + Dim outVarBool As Object + Dim outVarShort As Object + Dim outVarUShort As Object + Dim outVarLong As Object + Dim outVarULong As Object + Dim outVarFloat As Object + Dim outVarDouble As Object + Dim outVarString As Object + Dim outVarChar As Object + Dim outVarAny As Object + Dim outVarType As Object + + inByte = 10 + inBool = True + inShort = -10 + inUShort = -100 + inLong = -1000 + inHyper = CDec("-9223372036854775808") 'lowest int64 + inUHyper = CDec("18446744073709551615") ' highest unsigned int64 + inULong = 10000 + inFloat = 3.14 + inDouble = 3.14 + inString = "Hello World!" + inChar = 65 + inCharAsString = "A" + inAny = "Hello World" + inType = objServiceManager.Bridge_CreateType("[]long") + inXInterface = objCoreReflection + inXInterface2 = objEventListener + + retByte = objOleTest.in_methodByte(inByte) + retBool = objOleTest.in_methodBool(inBool) + retShort = objOleTest.in_methodShort(inShort) + retUShort = objOleTest.in_methodUShort(inUShort) + retLong = objOleTest.in_methodLong(inLong) + retULong = objOleTest.in_methodULong(inULong) + retHyper = objOleTest.in_methodHyper(inHyper) + retUHyper = objOleTest.in_methodUHyper(inUHyper) + retFloat = objOleTest.in_methodFloat(inFloat) + retDouble = objOleTest.in_methodDouble(inDouble) + retString = objOleTest.in_methodString(inString) + retChar = objOleTest.in_methodChar(inChar) + retChar2 = objOleTest.in_methodChar(inCharAsString) + retAny = objOleTest.in_methodAny(inAny) + retType = objOleTest.in_methodType(inType) + retXInterface = objOleTest.in_methodXInterface(inXInterface) ' UNO object + retXInterface2 = objOleTest.in_methodXInterface(inXInterface2) + + If retByte <> inByte Or retBool <> inBool Or retShort <> inShort Or retUShort <> inUShort _ + Or retLong <> inLong Or retULong <> inULong Or retHyper <> inHyper _ + Or retUHyper <> inUHyper Or retFloat <> inFloat Or retDouble <> inDouble _ + Or retString <> inString Or retChar <> inChar Or retChar2 <> Asc(inCharAsString) _ + Or retAny <> inAny Or Not (retType.Name = inType.Name) _ + Or inXInterface IsNot retXInterface Or inXInterface2 IsNot retXInterface2 Then + sError = "in - parameter and return value test failed" + MsgBox(sError) + + End If + + 'Out Parameter simple types + '================================================ + + + objOleTest.testout_methodByte(outByte) + objOleTest.testout_methodFloat(outFloat) + objOleTest.testout_methodDouble(outDouble) + objOleTest.testout_methodBool(outBool) + objOleTest.testout_methodShort(outShort) + objOleTest.testout_methodUShort(outUShort) + objOleTest.testout_methodLong(outLong) + objOleTest.testout_methodULong(outULong) + objOleTest.testout_methodHyper(outHyper) + objOleTest.testout_methodUHyper(outUHyper) + objOleTest.testout_methodString(outString) + objOleTest.testout_methodChar(outChar) + 'outCharAsString is a string. Therfore the returned sal_Unicode value of 65 will be converted + 'to a string "65" + objOleTest.testout_methodChar(outCharAsString) + objOleTest.testout_methodAny(outAny) + objOleTest.testout_methodType(outType) + 'objOleTest.in_methodXInterface (inXInterface) ' UNO object + Call objOleTest.in_methodXInterface(inXInterface) ' UNO object + objOleTest.testout_methodXInterface(outXInterface) + Call objOleTest.in_methodXInterface(inXInterface2) ' COM object + objOleTest.testout_methodXInterface(outXInterface2) + + If outByte <> inByte Or outFloat <> inFloat Or outDouble <> inDouble _ + Or outBool <> inBool Or outShort <> inShort Or outUShort <> inUShort _ + Or outLong <> inLong Or outULong <> inULong Or outHyper <> inHyper _ + Or outUHyper <> inUHyper Or outString <> inString Or outChar <> inChar _ + Or Not (outCharAsString = "65") Or outAny <> inAny _ + Or Not (outType.Name = inType.Name) Or inXInterface IsNot outXInterface _ + Or inXInterface2 IsNot outXInterface2 Then + + sError = "out - parameter test failed!" + MsgBox(sError) + End If + + 'Out Parameter simple types (VARIANT var) + '==================================================== + objOleTest.testout_methodByte(outVarByte) + objOleTest.testout_methodBool(outVarBool) + objOleTest.testout_methodChar(outVarChar) + objOleTest.testout_methodShort(outVarShort) + objOleTest.testout_methodUShort(outVarUShort) + objOleTest.testout_methodLong(outVarLong) + objOleTest.testout_methodULong(outVarULong) + objOleTest.testout_methodString(outVarString) + objOleTest.testout_methodFloat(outVarFloat) + objOleTest.testout_methodDouble(outVarDouble) + objOleTest.testout_methodAny(outVarAny) + objOleTest.testout_methodType(outVarType) + + If outVarByte <> inByte Or outVarBool <> inBool Or outVarChar <> inChar _ + Or outVarShort <> inShort Or outVarUShort <> inUShort _ + Or outVarLong <> inLong Or outVarULong <> inULong Or outVarString <> inString _ + Or outVarFloat <> inFloat Or outVarDouble <> inDouble Or outVarAny <> inAny _ + Or Not (outVarType.Name = inType.Name) Then + sError = "out - parameter (VARIANT) test failed!" + MsgBox(sError) + End If + + 'In/Out simple types + '============================================ + objOleTest.in_methodByte(0) + objOleTest.in_methodBool(False) + objOleTest.in_methodShort(0) + objOleTest.in_methodUShort(0) + objOleTest.in_methodLong(0) + objOleTest.in_methodULong(0) + objOleTest.in_methodHyper(0) + objOleTest.in_methodUHyper(0) + objOleTest.in_methodFloat(0) + objOleTest.in_methodDouble(0) + objOleTest.in_methodString(0) + objOleTest.in_methodChar(0) + objOleTest.in_methodAny(0) + objOleTest.in_methodType(objServiceManager.Bridge_CreateType("boolean")) + outXInterface = Nothing + Call objOleTest.in_methodXInterface(outXInterface) + + outByte = 10 + retByte = outByte + objOleTest.testinout_methodByte(retByte) + objOleTest.testinout_methodByte(retByte) + outBool = True + retBool = outBool + objOleTest.testinout_methodBool(retBool) + objOleTest.testinout_methodBool(retBool) + outShort = 10 + retShort = outShort + objOleTest.testinout_methodShort(retShort) + objOleTest.testinout_methodShort(retShort) + outUShort = 20 + retUShort = outUShort + objOleTest.testinout_methodUShort(retUShort) + objOleTest.testinout_methodUShort(retUShort) + outLong = 30 + retLong = outLong + objOleTest.testinout_methodLong(retLong) + objOleTest.testinout_methodLong(retLong) + outULong = 40 + retULong = outULong + objOleTest.testinout_methodULong(retLong) + objOleTest.testinout_methodULong(retLong) + outHyper = CDec("9223372036854775807") 'highest positiv value of int64 + retHyper = outHyper + objOleTest.testinout_methodHyper(retHyper) + objOleTest.testinout_methodHyper(retHyper) + outUHyper = CDec("18446744073709551615") 'highest value of unsigned int64 + retUHyper = outUHyper + objOleTest.testinout_methodUHyper(retUHyper) + objOleTest.testinout_methodUHyper(retUHyper) + outFloat = 3.14 + retFloat = outFloat + objOleTest.testinout_methodFloat(retFloat) + objOleTest.testinout_methodFloat(retFloat) + outDouble = 4.14 + retDouble = outDouble + objOleTest.testinout_methodDouble(retDouble) + objOleTest.testinout_methodDouble(retDouble) + outString = "Hello World!" + retString = outString + objOleTest.testinout_methodString(retString) + objOleTest.testinout_methodString(retString) + outChar = 66 + retChar = outChar + objOleTest.testinout_methodChar(retChar) + objOleTest.testinout_methodChar(retChar) + outCharAsString = "H" + retCharAsString = outCharAsString + objOleTest.testinout_methodChar(retCharAsString) + objOleTest.testinout_methodChar(retCharAsString) + outAny = "Hello World 2!" + retAny = outAny + objOleTest.testinout_methodAny(retAny) + objOleTest.testinout_methodAny(retAny) + outType = objServiceManager.Bridge_CreateType("long") + retType = outType + objOleTest.testinout_methodType(retType) + objOleTest.testinout_methodType(retType) + + outXInterface = objCoreReflection + retXInterface = outXInterface + objOleTest.testinout_methodXInterface2(retXInterface) + + If outByte <> retByte Or outBool <> retBool Or outShort <> retShort _ + Or outUShort <> retUShort Or outLong <> retLong Or outULong <> retULong _ + Or outHyper <> retHyper Or outUHyper <> outUHyper _ + Or outFloat <> retFloat Or outDouble <> retDouble _ + Or outString <> retString Or outChar <> retChar _ + Or outCharAsString <> retCharAsString _ + Or outAny <> retAny Or Not (outType.Name = retType.Name) _ + Or outXInterface IsNot retXInterface Then + sError = "in/out - parameter test failed!" + MsgBox(sError) + End If + + 'Attributes + objOleTest.AByte = inByte + retByte = 0 + retByte = objOleTest.AByte + objOleTest.AFloat = inFloat + retFloat = 0 + retFloat = objOleTest.AFloat + objOleTest.AType = inType + retType = Nothing + + retType = objOleTest.AType + + If inByte <> retByte Or inFloat <> retFloat Or Not (inType.Name = retType.Name) Then + sError = "Attributes - test failed!" + MsgBox(sError) + End If + + End Function + Function testHyper() As Object + + '====================================================================== + ' Other Hyper tests + Dim emptyVar As Object + Dim retAny As Object + + retAny = emptyVar + inHyper = CDec("9223372036854775807") 'highest positiv value of int64 + retAny = objOleTest.in_methodAny(inHyper) + sError = "hyper test failed" + If inHyper <> retAny Then + MsgBox(sError) + End If + inHyper = CDec("-9223372036854775808") 'lowest negativ value of int64 + retAny = objOleTest.in_methodAny(inHyper) + + If inHyper <> retAny Then + MsgBox(sError) + End If + inHyper = CDec("18446744073709551615") 'highest positiv value of unsigne int64 + retAny = objOleTest.in_methodAny(inHyper) + + If inHyper <> retAny Then + MsgBox(sError) + End If + inHyper = CDec(-1) + retAny = objOleTest.in_methodAny(inHyper) + If inHyper <> retAny Then + MsgBox(sError) + End If + inHyper = CDec(0) + retAny = objOleTest.in_methodAny(inHyper) + If inHyper <> retAny Then + MsgBox(sError) + End If + + '============================================================================== + + + End Function + Function testAny() As Object + Dim outVAr As Object + + 'Any test. We pass in an any as value object. If it is not correct converted + 'then the target component throws a RuntimeException + Dim lengthInAny As Integer + + lengthInAny = 10 + Dim seqLongInAny(10) As Integer + For i = 0 To lengthInAny - 1 + seqLongInAny(i) = i + 10 + Next + Dim anySeqLong As Object + anySeqLong = objOleTest.Bridge_GetValueObject() + anySeqLong.Set("[]long", seqLongInAny) + Dim anySeqRet As Object + Err.Clear() + On Error Resume Next + anySeqRet = objOleTest.other_methodAny(anySeqLong, "[]long") + + If Err.Number <> 0 Then + MsgBox("error") + End If + End Function + + Function testObjects() As Object + ' COM obj + Dim outVAr As Object + Dim retObj As Object + 'OleTest receives a COM object that implements XEventListener + 'OleTest then calls a disposing on the object. The object then will be + 'asked if it has been called + objEventListener.setQuiet(True) + objEventListener.resetDisposing() + retObj = objOleTest.in_methodInvocation(objEventListener) + Dim ret As Object + ret = objEventListener.disposingCalled + If ret = False Then + MsgBox("Error") + End If + + 'The returned object should be objEventListener, test it by calling disposing + ' takes an IDispatch as Param ( EventObject).To provide a TypeMismatch + 'we put in another IDispatch + retObj.resetDisposing() + retObj.disposing(objEventListener) + If retObj.disposingCalled = False Then + MsgBox("Error") + End If + + ' out param gives out the OleTestComponent + 'objOleTest.testout_methodXInterface retObj + 'outVAr = Null + 'retObj.testout_methodAny outVAr + 'Debug.Print "test out Interface " & CStr(outVAr) + 'If outVAr <> "I am a string in an any" Then + ' MsgBox "error" + 'End If + + + 'in out + ' in: UNO object, the same is expected as out param + ' the function expects OleTest as parameter and sets a value + + Dim myAny As Object + + + + Dim objOleTest2 As Object + objOleTest2 = objServiceManager.createInstance("oletest.OleTest") + 'Set a value + objOleTest2.AttrAny2 = "VBString " + + 'testinout_methodXInterfaces substitutes the argument with the object set in in_methodXInterface + objOleTest.AttrAny2 = "VBString this string was written in the UNO component to the inout pararmeter" + objOleTest.in_methodXInterface(objOleTest) + objOleTest.testinout_methodXInterface2(objOleTest2) + Dim tmpVar As Object + tmpVar = System.DBNull.Value + tmpVar = objOleTest2.AttrAny2 + Debug.Print("in: Uno out: the same object // " & CStr(tmpVar)) + If tmpVar <> "VBString this string was written in the UNO component to the inout pararmeter" Then + MsgBox("error") + End If + + + 'create a struct + Dim structClass As Object + structClass = objCoreReflection.forName("oletest.SimpleStruct") + Dim structInstance As Object + structClass.CreateObject(structInstance) + structInstance.message = "Now we are in VB" + Debug.Print("struct out " & structInstance.message) + If structInstance.message <> "Now we are in VB" Then + MsgBox("error") + End If + + 'put the struct into OleTest. The same struct will be returned with an added String + Dim structRet As Object + structRet = objOleTest.in_methodStruct(structInstance) + Debug.Print("struct in - return " & structRet.message) + If structRet.message <> "Now we are in VBThis string was set in OleTest" Then + MsgBox("error") + End If + + + End Function + Function testGetStruct() As Object + 'Bridge_GetStruct + '======================================================== + Dim objDocument As Object + objDocument = createHiddenDocument() + 'dispose not working i103353 + 'objDocument.dispose() + objDocument.close(True) + End Function + + Function testImplementedInterfaces() As Object + 'Bridge_ImplementedInterfaces + '================================================= + ' call an UNO function that takes an XEventListener interface + 'We provide a COM implementation (IDispatch) as EventListener + 'Open a new empty writer document + + Dim objDocument As Object + objDocument = createHiddenDocument() + objEventListener.resetDisposing() + objDocument.addEventListener(objEventListener) + objDocument.dispose() + If objEventListener.disposingCalled = False Then + MsgBox("Error") + End If + End Function + + Function testGetValueObject() As Object + 'Bridge_GetValueObject + '================================================== + Dim objVal As Object + objVal = objOleTest.Bridge_GetValueObject() + Dim arrByte(9) As Byte + Dim countvar As Integer + For countvar = 0 To 9 + arrByte(countvar) = countvar + Next countvar + + objVal.Set("[]byte", arrByte) + Dim ret As Object + ret = 0 + ret = objOleTest.methodByte(objVal) + 'Test if ret is the same array + + Dim key As Object + key = 0 + For Each key In ret + If ret(key) <> arrByte(key) Then + MsgBox("Error") + End If + Debug.Print(ret(key)) + Next key + + Dim outByte As Byte + outByte = 77 + Dim retByte As Byte + retByte = outByte + objVal.InitInOutParam("byte", retByte) + objOleTest.testinout_methodByte(objVal) + objVal.InitInOutParam("byte", retByte) + objOleTest.testinout_methodByte(objVal) + + ret = 0 + ret = objVal.Get() + Debug.Print(ret) + If ret <> outByte Then + MsgBox("error") + End If + + objVal.InitOutParam() + Dim inChar As Short + inChar = 65 + objOleTest.in_methodChar(inChar) + objOleTest.testout_methodChar(objVal) 'Returns 'A' (65) + ret = 0 + ret = objVal.Get() + Debug.Print(ret) + If ret <> inChar Then + MsgBox("error") + End If + + End Function + + Function testArrays() As Object + 'Arrays + '======================================== + Dim arrLong(2) As Integer + Dim arrObj(2) As Object + Dim countvar As Integer + For countvar = 0 To 2 + arrLong(countvar) = countvar + 10 + Debug.Print(countvar) + arrObj(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arrObj(countvar).setQuiet(True) + Next + + 'Arrays always contain VARIANTS + Dim seq() As Object + seq = objOleTest.methodLong(arrLong) + + For countvar = 0 To 2 + Debug.Print(CStr(seq(countvar))) + If arrLong(countvar) <> seq(countvar) Then + MsgBox("error") + End If + Next + seq = objOleTest.methodXInterface(arrObj) + Dim tmp As Object + For countvar = 0 To 2 + seq(countvar).resetDisposing() + seq(countvar).disposing(CObj(tmp)) + If seq(countvar).disposingCalled = False Then + MsgBox("Error") + End If + Next + + 'Array containing interfaces (element type is VT_DISPATCH) + Dim arEventListener(2) As Object + For countvar = 0 To 2 + arEventListener(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener(countvar).setQuiet(True) + Next + + 'The function calls disposing on the listeners + seq = objOleTest.methodXEventListeners(arEventListener) + Dim count As Object + For countvar = 0 To 2 + If arEventListener(countvar).disposingCalled = False Then + MsgBox("Error") + End If + Next + 'Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH + Dim arEventListener2(2) As Object + For countvar = 0 To 2 + arEventListener2(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener2(countvar).setQuiet(True) + Next + seq = objOleTest.methodXEventListeners(arEventListener2) + For countvar = 0 To 2 + If arEventListener2(countvar).disposingCalled = False Then + MsgBox("Error") + End If + Next + + 'Variant containing Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH + Dim arEventListener3(2) As Object + Dim var As Object + For countvar = 0 To 2 + arEventListener3(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener3(countvar).setQuiet(True) + Next + Dim varContAr As Object + varContAr = VB6.CopyArray(arEventListener3) + seq = objOleTest.methodXEventListeners(varContAr) + For countvar = 0 To 2 + If arEventListener3(countvar).disposingCalled = False Then + MsgBox("Error") + End If + Next + + 'Get a sequence created in UNO, out param is Variant ( VT_BYREF|VT_VARIANT) + Dim seqX As Object + + objOleTest.testout_methodSequence(seqX) + Dim key As Object + For Each key In seqX + Debug.Print(CStr(seqX(key))) + If seqX(key) <> key Then + MsgBox("error") + End If + Next key + 'Get a sequence created in UNO, out param is array Variant ( VT_BYREF|VT_VARIANT|VT_ARRAY) + Dim seqX2() As Object + objOleTest.testout_methodSequence(seqX2) + + For Each key In seqX2 + Debug.Print(CStr(seqX2(key))) + Next key + + 'pass it to UNO and get it back + Dim seq7() As Object + seq7 = objOleTest.methodLong(seqX) + Dim key2 As Object + For Each key2 In seq7 + Debug.Print(CStr(seq7(key2))) + If seqX2(key) <> key Then + MsgBox("error") + End If + Next key2 + + 'array with starting index != 0 + Dim seqIndex(2) As Integer + Dim seq8() As Object + Dim longVal1, longVal2 As Integer + longVal1 = 1 + longVal2 = 2 + seqIndex(1) = longVal1 + seqIndex(2) = longVal2 + 'The bridge returns a Safearray of Variants. It does not yet convert to an _ + 'array of a particular type! + 'Comparing of elements from seq8 (Object) with long values worked without _ + 'explicit cast as is necessary in VS 2008. Also arrays in VS 2008 start at _ + 'index 0 + seq8 = objOleTest.methodLong(seqIndex) + If longVal1 <> CInt(seq8(1)) And longVal2 <> CInt(seq8(2)) Then + MsgBox("error") + End If + + 'in out Array + ' arrLong is Long Array + Dim inoutVar(2) As Object + + For countvar = 0 To 2 + inoutVar(countvar) = countvar + 10 + Next + + objOleTest.testinout_methodSequence(inoutVar) + + countvar = 0 + For countvar = 0 To 2 + Debug.Print(CStr(inoutVar(countvar))) + If inoutVar(countvar) <> countvar + 11 Then + MsgBox("error") + End If + Next + + 'Multidimensional array + '============================================================ + ' Sequence< Sequence > methodSequence( Sequence< Sequence long> >) + ' Real multidimensional array Array + ' 9 is Dim 1 (least significant) with C API + Dim mulAr(9, 1) As Integer + For i = 0 To 1 + For j = 0 To 9 + mulAr(j, i) = i * 10 + j + Next j + Next i + + Dim resMul As Object + resMul = objOleTest.methodSequence(mulAr) + + Dim countDim1 As Integer + Dim countDim2 As Integer + Dim arr As Object + For countDim2 = 0 To 1 + arr = resMul(countDim2) + For countDim1 = 0 To 9 + Debug.Print(arr(countDim1)) + If arr(countDim1) <> mulAr(countDim1, countDim2) Then + MsgBox("Error Multidimensional Array") + End If + Next countDim1 + Next countDim2 + IsArray(resMul) + + 'Array of VARIANTs containing arrays + Dim mulAr2(1) As Object + Dim arr2(9) As Integer + For i = 0 To 1 + ' Dim arr(9) As Long + For j = 0 To 9 + arr2(j) = i * 10 + j + Next j + mulAr2(i) = VB6.CopyArray(arr2) + Next i + + resMul = 0 + resMul = objOleTest.methodSequence(mulAr2) + arr = 0 + Dim tmpVar As Object + For countDim2 = 0 To 1 + arr = resMul(countDim2) + tmpVar = mulAr2(countDim2) + For countDim1 = 0 To 9 + Debug.Print(arr(countDim1)) + If arr(countDim1) <> tmpVar(countDim1) Then + MsgBox("Error Multidimensional Array") + End If + Next countDim1 + Next countDim2 + + 'Array containing interfaces (element type is VT_DISPATCH) + Dim arArEventListener(1, 2) As Object + For i = 0 To 1 + For j = 0 To 2 + arArEventListener(i, j) = CreateObject("VBasicEventListener.VBEventListener") + arArEventListener(i, j).setQuiet(True) + Next + Next + 'The function calls disposing on the listeners + seq = objOleTest.methodXEventListenersMul(arArEventListener) + For i = 0 To 1 + For j = 0 To 2 + If arArEventListener(i, j).disposingCalled = False Then + MsgBox("Error") + End If + Next + Next + + 'Array containing interfaces (element type is VT_VARIANT containing VT_DISPATCH) + Dim arArEventListener2(1, 2) As Object + For i = 0 To 1 + For j = 0 To 2 + arArEventListener2(i, j) = CreateObject("VBasicEventListener.VBEventListener") + arArEventListener2(i, j).setQuiet(True) + Next + Next + 'The function calls disposing on the listeners + seq = objOleTest.methodXEventListenersMul(arArEventListener2) + For i = 0 To 1 + For j = 0 To 2 + If arArEventListener2(i, j).disposingCalled = False Then + MsgBox("Error") + End If + Next + Next + + ' SAFEARRAY of VARIANTS containing SAFEARRAYs + 'The ultimate element type is VT_DISPATCH ( XEventListener) + Dim arEventListener4(1) As Object + Dim seq1(2) As Object + Dim seq2(2) As Object + For i = 0 To 2 + seq1(i) = CreateObject("VBasicEventListener.VBEventListener") + seq2(i) = CreateObject("VBasicEventListener.VBEventListener") + seq1(i).setQuiet(True) + seq2(i).setQuiet(True) + Next + arEventListener4(0) = VB6.CopyArray(seq1) + arEventListener4(1) = VB6.CopyArray(seq2) + 'The function calls disposing on the listeners + seq = objOleTest.methodXEventListenersMul(arEventListener4) + For i = 0 To 2 + If seq1(i).disposingCalled = False Or seq2(i).disposingCalled = False Then + MsgBox("Error") + End If + Next + + End Function + + Function createHiddenDocument() As Object + 'Try to create a hidden document + Dim objPropValue As Object + objPropValue = objOleTest.Bridge_GetStruct("com.sun.star.beans.PropertyValue") + 'Set the members. If this fails then there is an Error + objPropValue.Name = "Hidden" + objPropValue.Handle = -1 + objPropValue.Value = True + + 'create a hidden document + 'Create the Desktop + Dim objDesktop As Object + objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") + 'Open a new empty writer document + Dim args(0) As Object + args(0) = objPropValue + createHiddenDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args) + End Function +End Module diff --git a/extensions/test/ole/VisualBasic/Project1.sln b/extensions/test/ole/VisualBasic/Project1.sln new file mode 100644 index 000000000000..ffff24e8d5d5 --- /dev/null +++ b/extensions/test/ole/VisualBasic/Project1.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Project1", "Project1.vbproj", "{F62D440E-8976-4A6D-91A8-89F09701074F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F62D440E-8976-4A6D-91A8-89F09701074F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F62D440E-8976-4A6D-91A8-89F09701074F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F62D440E-8976-4A6D-91A8-89F09701074F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F62D440E-8976-4A6D-91A8-89F09701074F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/VisualBasic/Project1.vbp b/extensions/test/ole/VisualBasic/Project1.vbp deleted file mode 100644 index 7de912c622bc..000000000000 --- a/extensions/test/ole/VisualBasic/Project1.vbp +++ /dev/null @@ -1,34 +0,0 @@ -Type=Exe -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINXP\System32\Stdole2.tlb#OLE Automation -Module=Module1; Module1.bas -Startup="Sub Main" -HelpFile="" -ExeName32="Project1.exe" -Command32="" -Name="Project1" -HelpContextID="0" -CompatibleMode="0" -MajorVer=1 -MinorVer=0 -RevisionVer=0 -AutoIncrementVer=0 -ServerSupportFiles=0 -VersionCompanyName="StarOffice" -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -Retained=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 - -[MS Transaction Server] -AutoRefresh=1 diff --git a/extensions/test/ole/VisualBasic/Project1.vbproj b/extensions/test/ole/VisualBasic/Project1.vbproj new file mode 100644 index 000000000000..213d5928ca97 --- /dev/null +++ b/extensions/test/ole/VisualBasic/Project1.vbproj @@ -0,0 +1,90 @@ + + + Local + WindowsFormsWithCustomSubMain + 9.0.21022 + 2.0 + {F62D440E-8976-4A6D-91A8-89F09701074F} + Debug + AnyCPU + Project1 + WinExe + Project1.Module1 + 1 + 0 + 0 + False + StarOffice + Project1 + + + + + .\bin\ + Project1.xml + True + True + True + Win32=True + x86 + 42016,42017,42018,42019,42032 + full + + + .\bin\ + Project1.xml + False + False + True + Win32=True + x86 + 42016,42017,42018,42019,42032 + none + + + + Microsoft.VisualBasic.Compatibility + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + \ No newline at end of file diff --git a/extensions/test/ole/VisualBasic/Project1.vbw b/extensions/test/ole/VisualBasic/Project1.vbw deleted file mode 100644 index 9b4c2b95fca6..000000000000 --- a/extensions/test/ole/VisualBasic/Project1.vbw +++ /dev/null @@ -1 +0,0 @@ -Module1 = 4, 4, 895, 913, diff --git a/extensions/test/ole/VisualBasic/readme.txt b/extensions/test/ole/VisualBasic/readme.txt index 22add1fb2141..0b18430fca7e 100644 --- a/extensions/test/ole/VisualBasic/readme.txt +++ b/extensions/test/ole/VisualBasic/readme.txt @@ -1,18 +1,18 @@ -Runs a test written in VisualBasic. If no error message appears then the test was ok. - -Requirements: -Installed office -Component oletest.Oletest (extensions/test/ole/cpnt) -Component VBasicEventListener.VBEventListener (extensions/test/ole/EventListenerSample/VBEventListener - - -OleTest is a UNO component. It needs to be registered with the office rdb. Also there are additional -types (oletest.rdb in wntmsci7/bin/) which must be merged with the rdb. -VBEventListener is an ActiveX component. The directory contains a Visual Basic Project and also -the binary VBasicEventListener.dll. This is necessary because the dll contains the type library -which is needed by VB. Otherwise VB would generate a new CLSID on a new build. -The dll must be registered on the system. This is done by -regsvr32 VBasicEventListener.dll -or -by a rebuild of the project. - +Runs a test written in VisualBasic. If no error message appears then the test was ok. + +Requirements: +Installed office +Component oletest.Oletest (extensions/test/ole/cpnt) +Component VBasicEventListener.VBEventListener (extensions/test/ole/EventListenerSample/VBEventListener + + +OleTest is a UNO component. It needs to be registered with the office rdb. Also there are additional +types (oletest.rdb in wntmsci7/bin/) which must be merged with the rdb. +VBEventListener is an ActiveX component. The directory contains a Visual Basic Project and also +the binary VBasicEventListener.dll. This is necessary because the dll contains the type library +which is needed by VB. Otherwise VB would generate a new CLSID on a new build. +The dll must be registered on the system. This is done by +regsvr32 VBasicEventListener.dll +or +by a rebuild of the project. + diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index 8a42a958c612..606a2193b794 100644 --- a/extensions/test/ole/cpnt/cpnt.cxx +++ b/extensions/test/ole/cpnt/cpnt.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include @@ -374,7 +374,7 @@ Sequence OComponent_getSupportedServiceNames(void) } -extern "C" sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey ) +extern "C" sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) { if(pRegistryKey) { @@ -395,7 +395,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void } extern "C" void * SAL_CALL component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) + const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { static void * pRet= NULL; if( ! pRet) @@ -421,7 +421,7 @@ extern "C" void * SAL_CALL component_getFactory( } extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) + const sal_Char ** ppEnvTypeName, uno_Environment ** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } @@ -983,11 +983,11 @@ void SAL_CALL OComponent::testout_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2= 1222; rout3= L" another string"; } -void SAL_CALL OComponent::testout_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException ) +void SAL_CALL OComponent::testout_methodMulParams3(const OUString&, 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) +void SAL_CALL OComponent::testout_methodMulParams4( float in1, float& out1, sal_Int32 in2, sal_Int32& out2, sal_Int32 ) throw(RuntimeException) { out1= in1 + 1; out2= in2 + 1; @@ -1091,11 +1091,11 @@ Reference SAL_CALL OComponent::in_methodInvocation( const Referenc try{ inv->invoke( OUString(RTL_CONSTASCII_USTRINGPARAM("disposing")), params, outIndex, outParams); - }catch(IllegalArgumentException & iae) { + }catch(IllegalArgumentException &) { } - catch(CannotConvertException & cce) { + catch(CannotConvertException &){ } - catch(InvocationTargetException& ite) { + catch(InvocationTargetException&) { } return inv; } @@ -1113,9 +1113,10 @@ SimpleStruct SAL_CALL OComponent::in_methodStruct( const SimpleStruct& aStruct ) "This string was set in OleTest")); return aStruct; } -void SAL_CALL OComponent::in_methodAll( sal_Int8 b, float f, double d, sal_Bool boo, sal_Int16 sh, sal_uInt16 us, - sal_Int32 l, sal_uInt32 ul, const OUString& s, sal_Unicode c, - const Any& a, const Type& t, const Reference& inv ) throw (RuntimeException) +void SAL_CALL OComponent::in_methodAll( + sal_Int8, float, double, sal_Bool, sal_Int16, sal_uInt16, + sal_Int32, sal_uInt32, const OUString&, sal_Unicode, + const Any&, const Type&, const Reference&) throw (RuntimeException) { } @@ -1324,7 +1325,7 @@ Property SAL_CALL OComponent::methodStruct2( const Property& aProp ) throw (Runt } // XTestOther ================================================================================== -void SAL_CALL OComponent::other_methodAnyIn(const Any& rAny) throw( RuntimeException ) +void SAL_CALL OComponent::other_methodAnyIn(const Any& ) throw( RuntimeException ) { } void SAL_CALL OComponent::other_methodAnyOut(Any& rAny) throw( RuntimeException ) @@ -1471,8 +1472,8 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac sal_Int8 aByte; sal_Int16 aShort; sal_Int32 aLong; - sal_uInt16 aUShort; - sal_uInt32 aULong; +// sal_uInt16 aUShort; +// sal_uInt32 aULong; switch( mode) { @@ -1590,8 +1591,8 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac sal_Int8 aByte; sal_Int16 aShort; sal_Int32 aLong; - sal_uInt16 aUShort; - sal_uInt32 aULong; +// sal_uInt16 aUShort; +// sal_uInt32 aULong; xCallback->outValuesAll( xSimple, aSimpleStruct, aSimpleEnum, seqAny, aAny, aBool, aChar, aString, aFloat, aDouble, @@ -1731,7 +1732,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac } case 108: { - float f= 3.14; + float f= 3.14f; xCallback->inoutFloat(f); char buff[1024]; sprintf( buff, "out value float: %f", f); @@ -1811,7 +1812,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac sal_Bool aBool= sal_True; sal_Unicode aChar= L'A'; OUString aString( L"OleTest"); - float aFloat=3.14; + float aFloat=3.14f; double aDouble= 3.145; sal_Int8 aByte= 0xf; sal_Int16 aShort= 0xff; @@ -1981,15 +1982,15 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac arAny[6] <<= L'B'; OUString stringParam(L" a string parameter"); arAny[7] <<= stringParam; - float _float= 3.14; + float _float= 3.14f; arAny[8] <<= _float; double _double= 3.145; arAny[9] <<= _double; - sal_Int8 _byte= 0xff; + sal_Int8 _byte= -1; arAny[10] <<= _byte; - sal_Int16 _short= 0xffff; + sal_Int16 _short= -1; arAny[11] <<= _short; - sal_Int32 _long= 0xffffffff; + sal_Int32 _long= -1; arAny[12] <<= _long; // Sequence params( arAny, 13); @@ -2089,7 +2090,7 @@ Reference< XInterface > SAL_CALL OComponent::getThis( ) throw (RuntimeException return ret; } -void SAL_CALL EventListener::disposing( const ::com::sun::star::lang::EventObject& Source ) throw (RuntimeException) +void SAL_CALL EventListener::disposing( const ::com::sun::star::lang::EventObject& ) throw (RuntimeException) { bCalled= sal_True; } diff --git a/extensions/test/ole/cpnt/readme.txt b/extensions/test/ole/cpnt/readme.txt index 2f9aab8fcadd..46d525efb285 100644 --- a/extensions/test/ole/cpnt/readme.txt +++ b/extensions/test/ole/cpnt/readme.txt @@ -1,15 +1,21 @@ -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. +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. Other clients, such as VBScript, VB and +C++ applications can also use this component for testing. +The service name is oletest.OleTest. +The uno types are also build in this folder. The idl file is in ..\idl. The +types rdb is in wntmscixx.pro\bin\oletest.rdb -The test is run by JavaScript contained in OleTest.htm and JScriptNewStyle.htm. +The service is used by: +OleTest.htm +JScriptNewStyle.htm +ScriptTest.html Prerequisites: -The oletest.dll ( build in this directory) must reside in the /program -directory and it must have been registered with regcomp.exe. -The types in wntmsci/bin/oletest.rdb must be merged with the applicat.rdb. oletest.rdb -is automatically build in this directory. However the idl file is in test/ole/idl. \ No newline at end of file +The oletest.dll must be registered, for example in the services.rdb, using +regcomp. Then the uno types contained in oletest.rdb (wntmscixx/bin) must be merged +for example in the offapi.rdb. This is done with regmerge. + diff --git a/extensions/test/ole/cppToUno/testcppuno.cxx b/extensions/test/ole/cppToUno/testcppuno.cxx index cc195ecc025d..3b22df40d3f2 100644 --- a/extensions/test/ole/cppToUno/testcppuno.cxx +++ b/extensions/test/ole/cppToUno/testcppuno.cxx @@ -31,13 +31,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" +#pragma warning(disable: 4917) #include #include #include #include -extern CComModule _Module; #include -#include #include #include #include @@ -50,9 +49,6 @@ extern CComModule _Module; #include -CComModule _Module; -BEGIN_OBJECT_MAP(ObjectMap) -END_OBJECT_MAP() using namespace com::sun::star::lang; using namespace com::sun::star::uno; @@ -62,13 +58,12 @@ using namespace com::sun::star::bridge::ModelDependent; using namespace cppu; using namespace rtl; HRESULT doTest(); -bool incrementMultidimensionalIndex(sal_Int32 dimensions, - const sal_Int32 * parDimensionLengths, - sal_Int32 * parMultidimensionalIndex); +bool incrementMultidimensionalIndex( + sal_Int32 dimensions, + const sal_Int32 * parDimensionLengths, + sal_Int32 * parMultidimensionalIndex); - - -int __cdecl _tmain( int argc, _TCHAR * argv[] ) +int __cdecl _tmain( int /*argc*/, _TCHAR * /*argv[]*/ ) { HRESULT hr; if( FAILED( hr=CoInitialize(NULL))) @@ -78,8 +73,6 @@ int __cdecl _tmain( int argc, _TCHAR * argv[] ) } - _Module.Init( ObjectMap, GetModuleHandle( NULL)); - if( FAILED(hr=doTest())) { _com_error err( hr); @@ -87,8 +80,6 @@ int __cdecl _tmain( int argc, _TCHAR * argv[] ) MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR); } - - _Module.Term(); CoUninitialize(); return 0; } @@ -99,7 +90,7 @@ int __cdecl _tmain( int argc, _TCHAR * argv[] ) HRESULT doTest() { HRESULT hr= S_OK; - long i,j; + long j = 0; SAFEARRAY* par; CComDispatchDriver disp; CComVariant result; @@ -118,7 +109,7 @@ HRESULT doTest() // one dimensional array par= SafeArrayCreateVector( VT_UI1, 0, 5); unsigned char arbyte[]= { 1,2,3,4,5}; - for( i= 0; i < 5;i++) + for(long i= 0; i < 5;i++) hr= SafeArrayPutElement( par, &i, &arbyte[i]); result.Clear(); @@ -173,7 +164,7 @@ HRESULT doTest() SAFEARRAY* arRet= result.parray; - for( i= 0; i < 2 ; i++) + for(long i= 0; i < 2 ; i++) { CComVariant varx; varx.Clear(); @@ -191,19 +182,16 @@ HRESULT doTest() } SafeArrayDestroy( par); - - - - } return hr; } // left index is least significant -bool incrementMultidimensionalIndex(sal_Int32 dimensions, - const sal_Int32 * parDimensionLengths, - sal_Int32 * parMultidimensionalIndex) +bool incrementMultidimensionalIndex( + sal_Int32 dimensions, + const sal_Int32 * parDimensionLengths, + sal_Int32 * parMultidimensionalIndex) { if( dimensions < 1) return sal_False; diff --git a/extensions/test/ole/cpptest/StdAfx.cpp b/extensions/test/ole/cpptest/StdAfx.cpp deleted file mode 100644 index f1b969bbd312..000000000000 --- a/extensions/test/ole/cpptest/StdAfx.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StdAfx.cpp,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -// 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 deleted file mode 100644 index 7e99b36035a4..000000000000 --- a/extensions/test/ole/cpptest/StdAfx.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StdAfx.h,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -// 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 -#include -#include -extern CComModule _Module; -#include -#include - - -// 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 deleted file mode 100644 index 20da03fc36be..000000000000 --- a/extensions/test/ole/cpptest/cpptest.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cpptest.cpp,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -// 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 spUnkMgr; - - - if( FAILED(hr= spUnkMgr.CoCreateInstance(L"com.sun.star.ServiceManager"))) - return hr; - - IDispatchPtr starManager; - // var starManager=new ActiveXObject("com.sun.star.ServiceManager"); - hr= starManager.CreateInstance(_T("com.sun.star.ServiceManager")); - // var starDesktop=starManager.createInstance("com.sun.star.frame.Desktop"); - _variant_t varP1(L"com.sun.star.frame.Desktop"); - _variant_t varRet; - CComDispatchDriver dispMgr(starManager); - hr= dispMgr.Invoke1(L"createInstance", &varP1, &varRet); - CComDispatchDriver dispDesk(varRet.pdispVal); - varP1.Clear(); - varRet.Clear(); - // var bOK=new Boolean(true); - - // var noArgs=new Array(); - // var oDoc=starDesktop.loadComponentFromURL("private:factory/swriter", "Test", 40, noArgs); - IDispatchPtr oDoc; - SAFEARRAY* ar= SafeArrayCreateVector(VT_DISPATCH, 0, 0); - _variant_t args[4]; - args[3]= _variant_t(L"private:factory/swriter"); - args[2]= _variant_t(L"Test"); - args[1]= _variant_t((long) 40); - args[0].vt= VT_ARRAY | VT_DISPATCH;; - args[0].parray= ar; - hr= dispDesk.InvokeN(L"loadComponentFromURL", args, 4, &varRet); - CComDispatchDriver dispDoc(varRet.pdispVal); - varRet.Clear(); - - //var oFieldMaster = oDoc.createInstance("com.sun.star.text.FieldMaster.Database"); - varP1= _variant_t(L"com.sun.star.text.FieldMaster.Database"); - hr= dispDoc.Invoke1(L"createInstance", &varP1, &varRet); - CComDispatchDriver dispFieldMaster(varRet.pdispVal); - varP1.Clear(); - varRet.Clear(); - - //var oObj = oDoc.createInstance("com.sun.star.text.TextField.Database"); - varP1= _variant_t(L"com.sun.star.text.TextField.Database"); - hr= dispDoc.Invoke1(L"createInstance", &varP1, &varRet); - CComDispatchDriver dispField(varRet.pdispVal); - varP1.Clear(); - varRet.Clear(); - - //oObj.attachTextFieldMaster(oFieldMaster); - varP1= _variant_t(dispFieldMaster); - hr= dispField.Invoke1(L"attachTextFieldMaster", &varP1); - - - return S_OK; - -} diff --git a/extensions/test/ole/cpptest/cpptest.cxx b/extensions/test/ole/cpptest/cpptest.cxx index 881907a57084..08c556cffad8 100644 --- a/extensions/test/ole/cpptest/cpptest.cxx +++ b/extensions/test/ole/cpptest/cpptest.cxx @@ -36,21 +36,15 @@ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 +#pragma warning(disable: 4917) #include #include #include -CComModule _Module; #include -#include - -//CComModule _Module; -BEGIN_OBJECT_MAP(ObjectMap) -END_OBJECT_MAP() - HRESULT doTest(); -int main(int argc, char* argv[]) +int main(int /*argc*/, char** /*argv*/) { HRESULT hr; if( FAILED( hr=CoInitialize(NULL))) @@ -59,9 +53,6 @@ int main(int argc, char* argv[]) return -1; } - - _Module.Init( ObjectMap, GetModuleHandle( NULL)); - if( FAILED(hr=doTest())) { _com_error err( hr); @@ -69,8 +60,6 @@ int main(int argc, char* argv[]) MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR); } - - _Module.Term(); CoUninitialize(); return 0; } @@ -86,12 +75,20 @@ HRESULT doTest() IDispatchPtr starManager; // var starManager=new ActiveXObject("com.sun.star.ServiceManager"); - hr= starManager.CreateInstance(_T("com.sun.star.ServiceManager")); + if (FAILED(hr= starManager.CreateInstance(_T("com.sun.star.ServiceManager")))) + { + fprintf(stderr, "creating ServiceManager failed\n"); + return hr; + } // var starDesktop=starManager.createInstance("com.sun.star.frame.Desktop"); _variant_t varP1(L"com.sun.star.frame.Desktop"); _variant_t varRet; CComDispatchDriver dispMgr(starManager); - hr= dispMgr.Invoke1(L"createInstance", &varP1, &varRet); + if (FAILED(hr= dispMgr.Invoke1(L"createInstance", &varP1, &varRet))) + { + fprintf(stderr,"createInstance of Desktop failed\n"); + return hr; + } CComDispatchDriver dispDesk(varRet.pdispVal); varP1.Clear(); varRet.Clear(); @@ -107,29 +104,13 @@ HRESULT doTest() args[1]= _variant_t((long) 40); args[0].vt= VT_ARRAY | VT_DISPATCH;; args[0].parray= ar; - hr= dispDesk.InvokeN(L"loadComponentFromURL", args, 4, &varRet); + if (FAILED(hr= dispDesk.InvokeN(L"loadComponentFromURL", args, 4, &varRet))) + { + fprintf(stderr,"loadComponentFromURL failed\n"); + return hr; + } CComDispatchDriver dispDoc(varRet.pdispVal); varRet.Clear(); - - //var oFieldMaster = oDoc.createInstance("com.sun.star.text.FieldMaster.Database"); - varP1= _variant_t(L"com.sun.star.text.FieldMaster.Database"); - hr= dispDoc.Invoke1(L"createInstance", &varP1, &varRet); - CComDispatchDriver dispFieldMaster(varRet.pdispVal); - varP1.Clear(); - varRet.Clear(); - - //var oObj = oDoc.createInstance("com.sun.star.text.TextField.Database"); - varP1= _variant_t(L"com.sun.star.text.TextField.Database"); - hr= dispDoc.Invoke1(L"createInstance", &varP1, &varRet); - CComDispatchDriver dispField(varRet.pdispVal); - varP1.Clear(); - varRet.Clear(); - - //oObj.attachTextFieldMaster(oFieldMaster); - varP1= _variant_t(dispFieldMaster); - hr= dispField.Invoke1(L"attachTextFieldMaster", &varP1); - - return S_OK; } diff --git a/extensions/test/ole/cpptest/cpptest.dsp b/extensions/test/ole/cpptest/cpptest.dsp deleted file mode 100644 index 3eb24f187265..000000000000 --- a/extensions/test/ole/cpptest/cpptest.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# 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 deleted file mode 100644 index 113f08492f76..000000000000 --- a/extensions/test/ole/cpptest/cpptest.dsw +++ /dev/null @@ -1,30 +0,0 @@ -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/cpptest/readme.txt b/extensions/test/ole/cpptest/readme.txt index f38b573a138d..4af8cfee39af 100644 --- a/extensions/test/ole/cpptest/readme.txt +++ b/extensions/test/ole/cpptest/readme.txt @@ -1,2 +1,6 @@ Creates the com.sun.star.ServiceManager with CoCreateInstance in a cpp program. -This little program can be used as starting point for further tests. \ No newline at end of file +This little program can be used as starting point for further tests. + + +It needs uwinapi.dll, which is in the program folder of OOo (URE\bin in +OOo 3.0) diff --git a/extensions/test/ole/unloading/readme.txt b/extensions/test/ole/unloading/readme.txt index 4320b1d0c3e7..d8b467ddfc8a 100644 --- a/extensions/test/ole/unloading/readme.txt +++ b/extensions/test/ole/unloading/readme.txt @@ -1,6 +1,6 @@ -This project builds a unloadtest.exe. - -Function: Tests if the unloading mechanism works with the olebrdg.dll. -In several tests, all services are created and destroyed and rtl_unloadUnusedModules is called. - -Usage: copy into the \program directory and run there. \ No newline at end of file +This project builds a unloadtest.exe. + +Function: Tests if the unloading mechanism works with the olebrdg.dll. +In several tests, all services are created and destroyed and rtl_unloadUnusedModules is called. + +Usage: copy into the \program directory and run there. diff --git a/extensions/test/ole/unloading/unloadTest.cxx b/extensions/test/ole/unloading/unloadTest.cxx index c4a630b0ddf5..18025ca466eb 100644 --- a/extensions/test/ole/unloading/unloadTest.cxx +++ b/extensions/test/ole/unloading/unloadTest.cxx @@ -60,7 +60,7 @@ sal_Bool test2(); sal_Bool test3(); sal_Bool test4(); -int main(int argc, char* argv[]) +int main(int, char**) { sal_Bool bTest1= test1(); sal_Bool bTest2= test2(); diff --git a/extensions/test/ole/unoTocomCalls/Test/Test.sln b/extensions/test/ole/unoTocomCalls/Test/Test.sln index 164d6f0fbaea..428b736251d9 100644 --- a/extensions/test/ole/unoTocomCalls/Test/Test.sln +++ b/extensions/test/ole/unoTocomCalls/Test/Test.sln @@ -1,21 +1,19 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test.vcproj", "{13AE4BE8-2467-4B35-800F-154379D54C24}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {13AE4BE8-2467-4B35-800F-154379D54C24}.Debug.ActiveCfg = Debug|Win32 - {13AE4BE8-2467-4B35-800F-154379D54C24}.Debug.Build.0 = Debug|Win32 - {13AE4BE8-2467-4B35-800F-154379D54C24}.Release.ActiveCfg = Release|Win32 - {13AE4BE8-2467-4B35-800F-154379D54C24}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test.vcproj", "{13AE4BE8-2467-4B35-800F-154379D54C24}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {13AE4BE8-2467-4B35-800F-154379D54C24}.Debug|Win32.ActiveCfg = Debug|Win32 + {13AE4BE8-2467-4B35-800F-154379D54C24}.Debug|Win32.Build.0 = Debug|Win32 + {13AE4BE8-2467-4B35-800F-154379D54C24}.Release|Win32.ActiveCfg = Release|Win32 + {13AE4BE8-2467-4B35-800F-154379D54C24}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/unoTocomCalls/Test/Test.vcproj b/extensions/test/ole/unoTocomCalls/Test/Test.vcproj index 501ed4e04697..f31d1ffc4eaa 100644 --- a/extensions/test/ole/unoTocomCalls/Test/Test.vcproj +++ b/extensions/test/ole/unoTocomCalls/Test/Test.vcproj @@ -1,160 +1,247 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp index 19a1229a902c..4f78b6d6a33a 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp @@ -223,7 +223,7 @@ STDMETHODIMP CCallback::outFloat(float *outFloat) { if( !outFloat) return E_POINTER; - *outFloat= 3.14; + *outFloat= 3.14f; return S_OK; } @@ -242,7 +242,7 @@ STDMETHODIMP CCallback::outShort(short *outShort) { if(!outShort) return E_POINTER; - *outShort= 0xffff; + *outShort= -1; return S_OK; } @@ -416,7 +416,7 @@ STDMETHODIMP CCallback::inoutShort(short *inoutVal) { if( !inoutVal) return E_POINTER; - *inoutVal= 0xffff; + *inoutVal= -1; return S_OK; } diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.def b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.def index 3fdc5686a563..b2d5e9627f4c 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.def +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.def @@ -3,8 +3,8 @@ LIBRARY "XCallback_Impl.DLL" EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.sln b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.sln index d603a7c1024b..62b109fe4afe 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.sln +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.sln @@ -1,33 +1,31 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XCallback_Impl", "XCallback_Impl.vcproj", "{92A6B531-401E-4900-8217-169A96F4168D}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release MinDependency - ConfigName.2 = Release MinSize - ConfigName.3 = Unicode Debug - ConfigName.4 = Unicode Release MinDependency - ConfigName.5 = Unicode Release MinSize - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {92A6B531-401E-4900-8217-169A96F4168D}.Debug.ActiveCfg = Debug|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Debug.Build.0 = Debug|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Release MinDependency.ActiveCfg = Release MinDependency|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Release MinDependency.Build.0 = Release MinDependency|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Release MinSize.ActiveCfg = Release MinSize|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Release MinSize.Build.0 = Release MinSize|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Debug.Build.0 = Unicode Debug|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinDependency.ActiveCfg = Unicode Release MinDependency|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinDependency.Build.0 = Unicode Release MinDependency|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinSize.ActiveCfg = Unicode Release MinSize|Win32 - {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinSize.Build.0 = Unicode Release MinSize|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XCallback_Impl", "XCallback_Impl.vcproj", "{92A6B531-401E-4900-8217-169A96F4168D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release MinDependency|Win32 = Release MinDependency|Win32 + Release MinSize|Win32 = Release MinSize|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Release MinDependency|Win32 = Unicode Release MinDependency|Win32 + Unicode Release MinSize|Win32 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {92A6B531-401E-4900-8217-169A96F4168D}.Debug|Win32.ActiveCfg = Debug|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Debug|Win32.Build.0 = Debug|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Release MinSize|Win32.ActiveCfg = Release MinSize|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Release MinSize|Win32.Build.0 = Release MinSize|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinDependency|Win32.ActiveCfg = Unicode Release MinDependency|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinDependency|Win32.Build.0 = Unicode Release MinDependency|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinSize|Win32.ActiveCfg = Unicode Release MinSize|Win32 + {92A6B531-401E-4900-8217-169A96F4168D}.Unicode Release MinSize|Win32.Build.0 = Unicode Release MinSize|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.vcproj b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.vcproj index c4037f8ea18b..1a9068d31482 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.vcproj +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.vcproj @@ -1,576 +1,816 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/unoTocomCalls/readme.txt b/extensions/test/ole/unoTocomCalls/readme.txt index 28dd560f03fd..40841cb0e8f6 100644 --- a/extensions/test/ole/unoTocomCalls/readme.txt +++ b/extensions/test/ole/unoTocomCalls/readme.txt @@ -1,9 +1,9 @@ -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 - -The projects in unoToComCalls test the functionality of COM -and JScript object which implement UNO interfaces. \ No newline at end of file +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 + +The projects in unoToComCalls test the functionality of COM +and JScript object which implement UNO interfaces. -- cgit v1.2.3