Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE -- WHAT AM I DOING WRONG??
Message
 
À
17/03/1998 12:47:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00084951
Message ID:
00085170
Vues:
36
>>Mark,
>It opens several instances of Word & the docu at the same time, and reduces my system memory to the point of stopping the system. Now Cetin gave some tips that I am going to use in order to avoid this.

Mark,

What you need to do to prevent the multiple instances of word is to use a reference to the word object that persists. If this suttf is all happening in a single form you can in the Init;
 LOCAL lnChan
 lnChan = DDEInitiate("Word","System")
 IF lnChan < 0
    * Word is not running
    THISFORM.WordWasRunning = .F.
    THISFORM.oWord = CreateObject("Word.Basic")
 ELSE
    DDETerminate(lnChan)
    THISFORM.WordWasRunning = .T.
    THISFORM.oWord = GetObject("Word.Basic")
 ENDIF
Now anywhere in that form or any of its controls you can refer to THISFORM.oWord as a rerference to the word object. In the destroy of the form you can;
 IF NOT THISFORM.WordWasRunning
    THISFORM.oWord.FileExit()
 ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform