Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Be aware: SYS(2335,0) stops exe from running
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Be aware: SYS(2335,0) stops exe from running
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01044130
Message ID:
01044130
Vues:
67
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

Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform