Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Be aware: SYS(2335,0) stops exe from running
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Be aware: SYS(2335,0) stops exe from running
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01044130
Message ID:
01044130
Views:
68
While I was playing with the following code, I discovered that if you put SYS(2335,0) in the init event of the class below, the exe just flashes and disappears. I am writing a windows service, so eventually I will want this function. At the same time, I am not able to run the exe when testing. The documentation says that the funciton only applies to _vfp.StartMode = 2 but doesn't state that it would stop an exe from running which wastes my time trying to find the cause of the problem.
PUBLIC oService as CIAEA OF MAIN.PRG

m.oService=CREATEOBJECT("CIAEA", ;
	IIF(_vfp.StartMode>0,ADDBS(JUSTPATH(_vfp.ServerName)),FULLPATH("")), ;
	IIF(_vfp.StartMode>0,ADDBS(JUSTPATH(_vfp.ServerName))+"data\",FULLPATH("")+"data\") ;
	)
MessageBox("Hello, what's going on?")  && I don't see this when I run the exe
m.oService.Show() && or this
READ EVENTS

DEFINE CLASS CIAEA as Form 
	PROCEDURE Init(lpcAppPath,lpcDataPath)	
		SYS(2335,0) && Unattended server support
	ENDPROC &&Init


	PROCEDURE Destroy
		CLEAR EVENTS 
	ENDPROC && Destroy
ENDDEFINE
So changing the code to this, then works:
if _vfp.StartMode = 2 ;
then 
	SYS(2335,0) && Unattended server support
endif 
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Next
Reply
Map
View

Click here to load this message in the networking platform