Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automation in VFP Applications
Message
De
24/03/2006 08:27:09
 
 
À
24/03/2006 04:45:15
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01107292
Message ID:
01107327
Vues:
20
>Hi All,
>
>I'd like to provide OLE Automation in our application (like MS Office). But I cannot make my application visible after client application releases reference.

I'm not sure this is graceful solution but..
Try to temporarily block application shutdown in Destroy event of the server class.
The server object is then released but other objects survive if their references are assigned to public variables.

Look at the sample server code:
DEFINE CLASS StayRunning As Session OLEPUBLIC
  HIDDEN PROCEDURE INIT 
    PUBLIC poBlockShutDown
    ON SHUTDOWN Do OnShutDown in stayrunning.prg
    
    _Screen.Show() &&Just to ensure that sample server is running
  ENDPROC 
  
  HIDDEN PROCEDURE DESTROY
    m.poBlockShutDown = .T.
  ENDPROC 

ENDDEFINE 


PROCEDURE OnShutDown
  IF poBlockShutDown THEN 
    m.poBlockShutDown = .F.
    RETURN 
  ENDIF 
  
  ON SHUTDOWN 
  QUIT
ENDPROC 
You may also add some property to the server to specify if application will stay running after server release or not.

Hope this helps.
/A new technology turns into completely outdated stuff before you have a time to read "Getting Started..." section.
/If there are some "system programmers" then others are unsystematic.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform