Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Hi,

I've got a problem with pseudo object no reachable when defined into library. The error message when I call new is :

"This object is not accessible. Invalid object reference."

Beloww is the Modul Test into library LibApplication, to define a Test object displaying a "Hello Box" dialog  when execute

REM  *****  BASIC  *****
Option Compatible
Option ClassModule

Option Explicit

Private _value As Integer
Private const _Msg = "Hello World"

' #PROCEDURE# ==================================================================
' Name...........: Class_Initialize
' Description ...:
' Parameters ....:
' Syntax ........: Class_Initialize
' Return values .:
' Modified.......:
' Remarks .......:
' Related .......:
' Link ..........:
' Example .......:
Private Sub Class_Initialize()
    _valute = 1
End Sub

' #PROCEDURE# ==================================================================
' Name...........: Class_Terminate
' Description ...:
' Parameters ....:
' Syntax ........: Class_Terminate
' Return values .:
' Modified.......:
' Remarks .......:
' Related .......:
' Link ..........:
' Example .......:
Private Sub Class_Terminate()
End Sub

Rem ***************************************************************************
Rem
Rem PROPRIETES
Rem
Rem ***************************************************************************

Rem ***************************************************************************
Rem
Rem METHODES PRIVEES
Rem
Rem ***************************************************************************

Rem ***************************************************************************
Rem
Rem METHODES PUBLIQUES
Rem
Rem *************************************************************************** ' #PROCEDURE# ==================================================================
' Name...........: Execute
' Description ...:
' Parameters ....:
' Syntax ........: Execute()
' Return values .:
' Modified.......:
' Remarks .......:
' Related .......:
' Link ..........:
' Example .......:
Public Sub Execute()
    MsgBox _Msg & " : " & _value
End Sub


Module to test into my main document :

Sub Test()
    If GlobalScope.BasicLibraries.hasByName("LibApplication") Then
        GlobalScope.BasicLibraries.loadLibrary("LibApplication")
    End If

if GlobalScope.BasicLibraries.isLibraryLoaded("LibApplication") Then
    Call Application.OpenConnection(ThisDatabaseDocument)
Else
    MsgBox("Librairie LibApplication non chargée !")
EndIf

Dim oTest As Object
Set oTest = new Test
oTest.execute()
Erase oTest
End Sub


Do you think it's not possible to use pseudo object code into library ? Do you know an other way than libraries to create domains (there is no folder to manage macros ...)


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.