From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../test/ole/DCOM/Clients/WriterDemo/Module1.bas | 25 +++ .../DCOM/Clients/WriterDemo/client_writerdemo.vbp | 33 ++++ .../DCOM/Clients/WriterDemo/client_writerdemo.vbw | 1 + .../test/ole/DCOM/Clients/WriterDemo/readme.txt | 4 + extensions/test/ole/DCOM/dcom_test/Module1.bas | 55 ++++++ extensions/test/ole/DCOM/dcom_test/dcom_test.vbp | 37 ++++ extensions/test/ole/DCOM/dcom_test/dcom_test.vbw | 1 + extensions/test/ole/DCOM/dcom_test/readme.txt | 5 + .../test/ole/DCOM/scriptComponents/WriterDemo.wsc | 186 +++++++++++++++++++++ .../test/ole/DCOM/scriptComponents/readme.txt | 12 ++ 10 files changed, 359 insertions(+) create mode 100644 extensions/test/ole/DCOM/Clients/WriterDemo/Module1.bas create mode 100644 extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbp create mode 100644 extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbw create mode 100644 extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt create mode 100644 extensions/test/ole/DCOM/dcom_test/Module1.bas create mode 100644 extensions/test/ole/DCOM/dcom_test/dcom_test.vbp create mode 100644 extensions/test/ole/DCOM/dcom_test/dcom_test.vbw create mode 100644 extensions/test/ole/DCOM/dcom_test/readme.txt create mode 100644 extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc create mode 100644 extensions/test/ole/DCOM/scriptComponents/readme.txt (limited to 'extensions/test/ole/DCOM') diff --git a/extensions/test/ole/DCOM/Clients/WriterDemo/Module1.bas b/extensions/test/ole/DCOM/Clients/WriterDemo/Module1.bas new file mode 100644 index 000000000..88153b174 --- /dev/null +++ b/extensions/test/ole/DCOM/Clients/WriterDemo/Module1.bas @@ -0,0 +1,25 @@ +rem +rem This file is part of the LibreOffice project. +rem +rem This Source Code Form is subject to the terms of the Mozilla Public +rem License, v. 2.0. If a copy of the MPL was not distributed with this +rem file, You can obtain one at http://mozilla.org/MPL/2.0/. +rem +rem This file incorporates work covered by the following license notice: +rem +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed +rem with this work for additional information regarding copyright +rem ownership. The ASF licenses this file to you under the Apache +rem License, Version 2.0 (the "License"); you may not use this file +rem except in compliance with the License. You may obtain a copy of +rem the License at http://www.apache.org/licenses/LICENSE-2.0 . +rem +Attribute VB_Name = "Module1" +Option Explicit + +Sub main() + Dim obj As Object + Set obj = CreateObject("dcomtest.writerdemo.wsc") + obj.run +End Sub diff --git a/extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbp b/extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbp new file mode 100644 index 000000000..ca477cff6 --- /dev/null +++ b/extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbp @@ -0,0 +1,33 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\stdole2.tlb#OLE Automation +Module=Module1; Module1.bas +Startup="Sub Main" +HelpFile="" +Command32="" +Name="client_writerdemo" +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/DCOM/Clients/WriterDemo/client_writerdemo.vbw b/extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbw new file mode 100644 index 000000000..067d7529e --- /dev/null +++ b/extensions/test/ole/DCOM/Clients/WriterDemo/client_writerdemo.vbw @@ -0,0 +1 @@ +Module1 = 108, 108, 685, 544, diff --git a/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt b/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt new file mode 100644 index 000000000..1d5a63492 --- /dev/null +++ b/extensions/test/ole/DCOM/Clients/WriterDemo/readme.txt @@ -0,0 +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). diff --git a/extensions/test/ole/DCOM/dcom_test/Module1.bas b/extensions/test/ole/DCOM/dcom_test/Module1.bas new file mode 100644 index 000000000..27908068c --- /dev/null +++ b/extensions/test/ole/DCOM/dcom_test/Module1.bas @@ -0,0 +1,55 @@ +rem +rem This file is part of the LibreOffice project. +rem +rem This Source Code Form is subject to the terms of the Mozilla Public +rem License, v. 2.0. If a copy of the MPL was not distributed with this +rem file, You can obtain one at http://mozilla.org/MPL/2.0/. +rem +rem This file incorporates work covered by the following license notice: +rem +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed +rem with this work for additional information regarding copyright +rem ownership. The ASF licenses this file to you under the Apache +rem License, Version 2.0 (the "License"); you may not use this file +rem except in compliance with the License. You may obtain a copy of +rem the License at http://www.apache.org/licenses/LICENSE-2.0 . +rem +Attribute VB_Name = "Module1" +Option Explicit + +Sub main() + +MsgBox "hallo" + +'The service manager is always the starting point +'If there is no office running then an office is started up +Dim objServiceManager As Object +Set objServiceManager = CreateObject("com.sun.star.ServiceManager") + +'Create the CoreReflection service that is later used to create structs +Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") + +'Create the Desktop +Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") + +'Open a new empty writer document + +Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") +'get a type description class for Size +Set propClass = objCoreReflection.forName("com.sun.star.beans.PropertyValue") + +Dim prop +propClass.CreateObject prop +prop.Name = "Hidden" +prop.Value = True + +'create the actual object +Dim args(0) +Set args(0) = prop + +Dim args2() +'Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args) +Set objDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args2) + +End Sub diff --git a/extensions/test/ole/DCOM/dcom_test/dcom_test.vbp b/extensions/test/ole/DCOM/dcom_test/dcom_test.vbp new file mode 100644 index 000000000..5b896434f --- /dev/null +++ b/extensions/test/ole/DCOM/dcom_test/dcom_test.vbp @@ -0,0 +1,37 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\stdole2.tlb#OLE Automation +Module=Module1; ..\..\..\..\..\..\Projects\VBasic\dcom_test\Module1.bas +Startup="Sub Main" +HelpFile="" +Title="dcom_test" +ExeName32="dcom_test.exe" +Path32="..\..\..\..\..\..\Projects\VBasic\dcom_test" +Command32="" +Name="dcom_test" +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 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/extensions/test/ole/DCOM/dcom_test/dcom_test.vbw b/extensions/test/ole/DCOM/dcom_test/dcom_test.vbw new file mode 100644 index 000000000..dfe34e0d1 --- /dev/null +++ b/extensions/test/ole/DCOM/dcom_test/dcom_test.vbw @@ -0,0 +1 @@ +Module1 = 1, 1, 849, 604, Z diff --git a/extensions/test/ole/DCOM/dcom_test/readme.txt b/extensions/test/ole/DCOM/dcom_test/readme.txt new file mode 100644 index 000000000..215d6f409 --- /dev/null +++ b/extensions/test/ole/DCOM/dcom_test/readme.txt @@ -0,0 +1,5 @@ +The program creates the com.sun.star.Servicemanager on a remote machine: + +Set objServiceManager = CreateObject("com.sun.star.ServiceManager", "\\jl-1036") + +creates a document and writes in it. \ No newline at end of file diff --git a/extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc b/extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc new file mode 100644 index 000000000..51419022f --- /dev/null +++ b/extensions/test/ole/DCOM/scriptComponents/WriterDemo.wsc @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + diff --git a/extensions/test/ole/DCOM/scriptComponents/readme.txt b/extensions/test/ole/DCOM/scriptComponents/readme.txt new file mode 100644 index 000000000..5fa3a8bb7 --- /dev/null +++ b/extensions/test/ole/DCOM/scriptComponents/readme.txt @@ -0,0 +1,12 @@ +WriterDemo.wsc +================================================================================= +Register the component by right-clicking on the file in the file explorer and select +register. +The component registered as being remotable.That is, it has got an AppID entry (with +a DllSurrogate subkey).That enables us to use dcomcnfg.exe in order to set AccessPermissions,etc. +which is necessary because of the use of the JScript Array object. The automation +bridge will query for IDispatchEx,which is a call from server to client.Hence the server +needs the proper right within the client. + +The component implements a run function, which runs the demo example that is written +in JScript. -- cgit v1.2.3