Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running VFP application as a service
Message
From
26/11/2005 17:20:15
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01070719
Message ID:
01072221
Views:
40
Hi Sergey,

Actually in my sample (message #1071516) I tried to resemble what I understood about Calvin's example (a simple timer loop doing something - "The code executes the timer event every 5 seconds, aligned to the 5 second real time clock (so that it occurs at exactly :00, :05, :10, … seconds past the hour).").

To be honest with you I couldn't follow the part bellow ("The sample service code below executes a file called “vfpsrvrtn.prg” when the timer fires. However, this code is not built into the EXE. This means you can change the service’s behavior dynamically, without having to stop/rebuild/start the service"):
Create VFPSRVRTN.PRG that just beeps
SET TEXTMERGE TO vfpsrvrtn.prg
      \LPARAMETERS oTimer,oService
      \oService.logstr("")
      \Messagebeep(0)
SET TEXTMERGE TO 
*RETURN 
BUILD PROJECT vfpsrv from vfpsrv 
MODIFY PROJECT vfpsrv nowait
STRTOFILE("screen=off"+CHR(13)+CHR(10),"config.fpw")  && to hide the VFP runtime desktop
_vfp.ActiveProject.Files.Add("config.fpw")
_vfp.ActiveProject.Close
BUILD EXE vfpsrv FROM vfpsrv 
ERASE config.fpw
Anyway there is an obscure part (parameter passing) that was a bit hard to figure out when registering the service (registry and instsrv). We found elsewhere instsrvw.exe that found a lot less cumbersome.

Just by using [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VFPSrv\Parameters]
"AppDirectory"="d:\\fox90\\test" "Application"="d:\\fox90\\test\\vfpsrv.exe" "AppParameters"="myparm1 myparm2" actually didn't work.

I can't believe that either I'm too naive or that stuff is so hard to work.

If it's not too much to ask, did you try to make my sample work? If so, what is wrong with it?

Thanks again, for being so patient with me.

Have a nice weekend!

Fernando

>Hi Fernando,
>
>I don't have a problem running Calvin's sample service. I would recomend that you start with Calvin's example and go from there.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform