Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating Office Objects
Message
De
05/10/1998 14:26:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Creating Office Objects
Divers
Thread ID:
00143958
Message ID:
00143958
Vues:
64
I am a little unclear on the following point. When an Office object is created from VFP or even VB, such as an Outlook item, eg:

olApp = CreateObject("Outlook.Application") && Outlook object
olNameSpace = olApp.GetNameSpace("MAPI") && Namespace object
oEvent = olApp.CreateItem(1) && An appointment item
oEvent.display && Show it

After the item is displayed, the code continues to execute since there is no mechanism to pause it. So if the variables are Local and the method/procedure ends, or I set the item object to null:

oEvent = Null

the Outlook object item still remains happily displayed and active and can be manipulated by the user as desired. The question is, is this an acceptable/appropriate way to handle this, or should some variable/property that does not go out of scope be used to hold the object. Even so, there is no way ( that I know of ) to know when the user has finished doing what they do with the created item that it might then be "destroyed". But there is something unsettling to me about the object variable going out of scope or otherwise being "destroyed" while the item that was created chugs merrily on its way and I just forget about it.

Am I missing something here? I realize this may be reasonably vague as my thoughts are somewhat muddled on the issue and I would welcome explanations/comments/questions for clarification concerning it.

Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform