Hi All,
Is it possible to have a global object in Notes or can we persist an object and retrive it later in another form or view.
I tried Profile Document but we cannot store objects.
I would like to know, is there any other API through which we can have a object holded in the memory like NotesSession and NotesUIWorkspace which are global and are live all through the session.
Thanks in advance,
Agasthya
Subject: Global objects or object persistence?
Hi Asasthya,
Can you be a bit more specific about “object” and what you’re trying to do and maybe I / we can help?
Mark
LogicSpot
UK
Subject: RE: Global objects or object persistence?
Hi Mark,
I use COM objects and customize the Notes application. I need to hold one object through out the Notes(Database) session from start till end. I tried making it global but found it is not possible.
Once I create the COM object I would like to keep that live till the Database is closed.
Now what i am doing is for each view, form etc. I am creating the COM object then initialize the object, this is the over head and I want to avoid it by having a global variable and hold the object live.
Thanks in advance,
Agasthya
Subject: RE: Global objects or object persistence?
Hi Agasthya (sorry for spelling name wrong last time)
A little bit out of my depth here … but I would suggest that the COM object needs to be instated on DB open using the PostOpen script, and then closed later, using QueryClose event.
If you’re still struggling lots, let me know and I’ll get one of our COM guys onto this.
Regards
Mark Haller
LogicSpot
UK
Subject: RE: Global objects or object persistence?
Hi,
Even I had similar issue, I need to hold the values globally. Do you have any solution?
Thanks,
Ashoka
Subject: RE: Global objects or object persistence?
Hi Mark,
I tried having it in the Database Script Postopen, but what happens is the variable is local to that script and i am not able to declare it as static or Public. So, the object is not accessable from the views and forms.
I think I am missing some thing…
Thanks in advance,
Agasthya
Subject: RE: Global objects or object persistence?
Hi Agasthya,
I am not a COM man … but if the object is instantiated in memory, you can surely use any of the methods or properties or classes of that object to get/set values and carry out methods on the object?
Do you want to send me a sample of the DB and the COM object and I’ll look at it here?
If you do, you can mail -
mark at logicspot dot com
and I’ll look at it later this evening
Regards
Mark
Subject: RE: Global objects or object persistence?
There is no way to directly do what you’re trying to do. The different LotusScript programs (in a database script vs. in a form script) each have their own separate variable space.
If you “Uselsx” a C or C++ library, it has its own memory management – it can retain its globals for as long as the Notes client is running, and it’s possible for different pieces of LotusScript code to access them if the LSX provides methods for doing so.
I don’t offhand know of a library that would do this particular task, but you could ask around. And search in here and in the R4/5 forum; the question has been asked before, multiple times.
Subject: RE: Global objects or object persistence?
Hi Andre,
Thanks once again, this is the second time i am posting this. Initially you suggested to have Profile Document, but holding an object is not possible.
I am trying LSX, hope i will have some workaround.
Thanks,
Agasthya