Tomaz Stih
December 20th, 1999, 08:04 AM
Is the following combination possible and how do I do it:
1.have singleton COM object (only one instance of certain class on the server and accessed via DCOM)
2.put it into MTS (so must be dll)?
3.do not have to run it myself but is run when first client gets reference to it.
Sincerely,
Tomaz
Mikesc
December 20th, 1999, 08:45 AM
Not entirely sure about this but maybe it will help.
1. Somebody put up an example for creating a singleton class in VB on this board. I don't remember it completely but if you look you probably will be able to find it.
2. To use the singleton component with MTS, you would have to set the 'retain in memory' option for it. (If this would work or not depends, I guess, on the singleton implementation.)
3. I think this happens automatically with MTS.
*** I believe the singleton class example did something like have a class that creates another class... if you do this in MTS you need to be careful about how you set the object reference in your component. There are subtle differences in the way CreateObject, New, and CreateInstance, go about creating other objects in MTS. I wish I could tell you more but I'm only just learning this stuff myself.
You might also want to look into object pooling if you have win2000.
Good luck. Hopefully someone else will have some more concrete info for ya