Basic pseudo object code no reachable when defined into a basic library...

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#

Hi Patrick,

typo spotted in the Initialize sub :

Private Sub Class_Initialize()
     _valute = 1
End Sub

instead of

Private Sub Class_Initialize()
     _value = 1
End Sub

Best,

Hi :slight_smile:
Oooo there's some value in a nice cuppa T.
Regards from
a Tom :slight_smile:

Hi,

Thanks-you Jean-Francois for your correction. But it's not enought, the problem is still here ... I finded why : The new operator failed to load pseudo object code into a library from a document's call. It's same problem for GlobalScope library (inter-contener call) or Document library (inner-contener call).

But I can replace it with a function factory stored into the library and called from my document ... :

Hello Patrick,

(response in English that transcripts my private email in French)

Note : The Erase function call look's to run perfectly ...

Why don't you use the usual
Set MyObject = Nothing

This is just a question. I'm not sure about the actual difference between both approaches.

So I need to add a specific modul in pseudo object library with factories ...

Don't you think that having an object factory in each class module would be easier to maintain? Or is this impractical?

Best regards,