Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OVariables and memory space...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00128435
Message ID:
00129602
Vues:
22
>>>>I need to have an object that is accessable from any instance of the program on our LAN. In other words I need to instantiate an object at login of the first user to execute the .exe from whatever workstation, Win95, Win98, or WinNT. The program will reside on an NT workstation or NTServer. Subsequent executions of the same program will need to access methods and properties of the original object. Then, when the last user quits the program, the object will be released. My question is, before I create a mountain of code that doesn't work across platforms, do all the platforms mentioned use the memory space on the box where the program resides? Or do some use local memory space? Also, is the scope of an object limited to the application that created it even if declared public? I've never tried this before, but I noticed with one of our 2.6 projects, we had to copy the foxlibs to the local machine in Win98 but do not have to do this with Win95. This makes me wonder if programs are
>>>>executed differently across the LAN after Win95.
>>>>
>>>
>>>Create a DCOM Object, and add a reference count property to it; have methods to attach (increment) and detach (decrement) reference counts. Whenever detach decrements to 0, force the COM server to shut down.
>>>
>>>In VFP, issue a CREATEOBJ() to instantiate the out-of-process server (or attach to an already running instance) and then invoke the attach and detach methods as appropriate.
>>
>>Is there any documentation on how to create an out of process server?
>>Never done it... Is there a class available in NT or VFP?
>>
>
>There is no 'class' per se - an out of process server is simply a VFP OLE Automation Server. Create a project, and include one or more OLEPUBLIC classes; creating an executable file. The executable then becomes an out-of-process server, running in its own memory space. It can be deployed from any system, and accessed via GETOBJECT() or CREATEOBJECT(). Take a look at chapter 16 in the Developer's Guide.


So Far,

I've got an OLE server that starts and runs fine now. Couple of problems I'm seeing so far, the server is launched from c:\winnt\system32. This is fine but it doesn't respect set path to or set default. It also hangs if I try to open a database with an absolute path. Also, it is registered as multiuser but it is not seen by other instances of VFP interactively. Obviously, I don't want to createobject() everytime it is accessed. The getobject() command accepts a file as the first parameter ie. .doc or .xls then launches some known application via the API .dlls. This does not work for 'custom' publicole servers. The syntax mentioned in ch16 sez GETOBJECT(, 'classname') to access an object without starting a new instance. The error 'function not available' is returned. The process is running according to task manager but when I start another instance of Fox, it can't see it or I'm using the wrong command to access a 'living' custom OLE out-of-process server. Also, I'm not sure what 'deployed' means. Any help?

Eric K.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform