>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()
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.