Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Public User Defined Property
Hi All,
I have created a COM server in VFP. A path to a VFP database is passed to the init method of the COM object. The init method then calls another method to see if the path is valid (DIRECTORY(tcPath)). If the path is not valid, I want to return some type of error that I can trap in Excel or Word.
I created a new property called cStatus that is initialized to an empty string. If the method that attempts to open a database using the path that was passed to the init method is invalid, I stuff the cStatus property with some text indicating that the path is invalid.
So far, so good. Now if I instantiate the class in vfp, the cStatus propety is updated correctly. However, in Excel (or VFP for that matter), if I instaniate the com server and pass a bad path to the init of the com object, the cStatus propety is never updated. It always contains an empty string.
Is there some way for the client to know if the path is invalid? How do I return something letting the client (Excel or Word) know there is a problem.
By the way the visibility of cStatus is public.
Thanks,
Pat Moran
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement