Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Share VFP objects
Message
De
17/03/2009 14:06:49
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
17/03/2009 13:34:56
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01388398
Message ID:
01388766
Vues:
36
I suppose you could use GetObject(), but I think you would also get only one instance if you used CreateObject(). In any case, the objects still get created as two separate local objects inside the VFP server, so the properties won't be the same. If you want to share values across instances, you should add them as properties to your application object (if you have one) or _Screen, or if you have to, create public variables. In other words, make the values visible to all objects just like you would in a normal VFP client application. Also, make sure you create a single-threaded EXE or DLL.

>I tried to create first copy with createobject and a second with getobject inside of same VFP session. Properties values assigned for the first copy did not have same values in the second one.
>
>>Hi Mark,
>>
>>>Is there any chance to be able to attach to an existing VFP running process? Something getobject() would do, but it's not working for me.
>>>The idea is: an VFP multi use EXE gets started and it's running in the memory with no user interface. Another VFP process attaches to it to share first process's objects.
>>>
>>
>>Is this all running on one machine? If so, then building the project as a multi-user server should do what you want. Here is what VFP Help says about it:
>>
>>Multi Use Specifies that you can create an instance of the class both inside Visual FoxPro and outside of Visual FoxPro using Automation. Each request for an instance of the class by an Automation client outside of the project causes an already running copy of the Automation server to be provided as the source for the new instance. Once the server has been created, other applications can use the same instance.
>>
>>If you need to run it on another machine, then you'll have to use COM+ like Craig said. I believe COM+ includes an interface that will show you how many instances of an object are running. Refer to Craig's articles for info on that.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform