Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating Thermometer from COM object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00479681
Message ID:
00480009
Vues:
45
>>What is the best method for updating a thermometer from a COM object? I have several processes that I am putting into middle-tier classes that can be instantiated either as normal classes or COM objects. I'd like to keep the user updated on the progress of the process by passing the percentage complete back to the thermometer.
>>
>>I know this would be a perfect situation for VFP7 and its ability to work with COM events, but I'd like to know how others are handling this now in VFP6. I've thought about passing the object reference of the thermometer form to the middle-tier object, but that would mean that it has to know how to update the thermometer. This would cause problems if the calling program used a different thermometer, plus I think this would be putting GUI code in the middle tier. I've also thought about using a timer to poll a percentage completed parameter on the object, but I would prefer a more passive approach. Any suggestions?
>
>Hi Joel,
>
>The best way is to raise an event from your COM module and use VFPCOM.DLL from the client to bind the events. This way the COM module is not aware and does not care at all who is receiving the events.
>
>Read my article "Raise Events From Your Applications" in February 2001 FoxPro Advisor - it is exactly about what you want to achieve. There are sample forms with the progress bar for COM and DCOM.
>
>Since VFP itself cannot raise an event, a little VB6 COM object called EventRaiser does the event raising instead. This way you can even create a full visual interface for your COM, if you want.

Thanks Nick. I'll take a look at the article.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform