Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automation in VFP Applications
Message
From
24/03/2006 08:27:09
 
 
To
24/03/2006 04:45:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01107292
Message ID:
01107327
Views:
22
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform