Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public User Defined Property
Message
 
 
À
03/07/2002 09:55:03
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00674913
Message ID:
00674929
Vues:
27
Maybe I'm missing something, but I don't see how passing path to the init would resolve your problem. Anyway you've to tell your COM object what hospital you're working with by specifing a path or some other info.

>Thanks for the reply Sergey,
>
>Here is what I'm trying to do. I have written a VFP application that is being used in all of the state hospitals. The application is installed on 15 different servers (one server for each state facility). Each facility (server) has it's own databases for the application.
>
>The users would like to be able to access a patients balance without using the application. For example, in Excel, I placed a command button on a sheet. The user enters the patient number and clicks the button. The VBA code then instantiates the com server and returns a patient balance to the spreadsheet.
>
>I would like to be able to pass the path to the database to this com server somehow so I know which databases to open. Each facility has their own databases. I guess I could send this excel spreadsheet to each facility (after I hard code the paths), but I would rather maintain one spreadsheet vs. 15. Any ideas?
>
>Thanks,
>Pat
>
>>You cannot pass parameters to the COM object init.
>>
>>>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform