diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
commit | 940b4d1848e8c70ab7642901a68594e8016caffc (patch) | |
tree | eb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /extensions/test/ole/DCOM/dcom_test | |
parent | Initial commit. (diff) | |
download | libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.tar.xz libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.zip |
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extensions/test/ole/DCOM/dcom_test')
-rw-r--r-- | extensions/test/ole/DCOM/dcom_test/Module1.bas | 55 | ||||
-rw-r--r-- | extensions/test/ole/DCOM/dcom_test/dcom_test.vbp | 37 | ||||
-rw-r--r-- | extensions/test/ole/DCOM/dcom_test/dcom_test.vbw | 1 | ||||
-rw-r--r-- | extensions/test/ole/DCOM/dcom_test/readme.txt | 5 |
4 files changed, 98 insertions, 0 deletions
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 |