Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Build exe - my program doesn't work - vfp3
Message
De
09/06/1998 21:38:30
 
 
À
09/06/1998 18:36:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00106522
Message ID:
00106551
Vues:
29
>I have the progessional version of vfp3
>
>First I built an EXE and it exited immediately after it started. I look in the manual - I see:
>
>"Troubleshooting: If your menu system works in the development environment but closes prematurely in your application, make sure you have a READ EVENTS command active while your menu system is running. Also be sure to include a CLEAR EVENTS command when you exit the menu system."
>
>Well... where do I put it? In various places, I get various different results (the load event of the main form, the unload event...) but the program doesn't function (my form window opens without any objects on it and just sits there.) I had to use ctrl+alt+delete - endtask to kill it! Aarrgh!



As previously ppl said... Let take a look my main.prg to see which code you need!!
ON ERROR DO errhand WITH ;
	ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
_screen.windowstate = 2
_screen.visible = .T.
_screen.caption = "My Company Name"
_dblclick = 1
SET ANSI OFF		&& i.e. 'Tommy' = 'Tom'
SET AUTOSAVE ON	&& Save At Once if possible
SET CENTURY ON	&& YYYY
SET CENTURY TO 19 ROLLOVER 80	&& 19YY
SET DATE TO MDY	&& 01/16/1994
*SET DECIMALS TO 2	&& 9,999.99
SET DEFAULT TO		&& LEFT(SYS(2005), RAT("\", SYS(2005))-1)
SET DELETE OFF		&& ALLOW TO ON WHEN NEEDED!
SET DEVELOPMENT ON	&& Recompile code when change
SET EXACT OFF		&& Compare Flag
SET EXCLUSIVE OFF	&& Allow Share in Using
*SET FIXED ON		&& CUT DECIMALS TO 2
SET MESSAGE TO		&& Ensure Message is show out!!
SET MULTILOCK ON	&& Allow lock more than 1 lock
SET NEAR ON		&& Search Near if Possible for non-match
SET REPROCESS TO AUTOMATIC	&& Auto Try if Fail in lock
**SET RESOURCE ON	&& Do not Create FoxUser.* cause Error on log!!
*SET SYSMENU TO	&& Easy for Debug
SET HELP ON			&& Use VFP Help File to Fix Bug!
IF FILE("C:\PROGRAM FILES\VFP\FOXHELP.HLP")
	SET HELP TO	"C:\PROGRAM FILES\VFP\FOXHELP.HLP"		&& Use VFP Standard Help
ENDIF
ON ESCAPE RESUME
ON SHUTDOWN QUIT
*** The next line go to right Path!! ***

LOCAL fLovehome

SET CLASSLIB TO qiantang ADDITIVE  && If needed!!
SET CLASSLIB TO lovehome ADDITIVE
SET CLASSLIB TO no_ime ADDITIVE
SET CLASSLIB TO incsrch1 ADDITIVE
fLovehome = CREATEOBJECT("lovelyHM")
fLovehome.show
DO LOVEHOME.MPR
READ EVENTS

* ERROR ON LOAD DATA OVER 32K, SO IGNORE IT!! ~_~"
ON ERROR WAIT "" WINDOW NOWAIT	
RELEASE CLASSLIB qiantang
RELEASE CLASSLIB lovehome
RELEASE CLASSLIB no_ime
RELEASE CLASSLIB incsrch1

_screen.caption = "Microsoft Visual Foxpro: Development Control"
SET SYSMENU TO DEFAULT	&& Easy for Debug
CLEAR ALL
ON ERROR
SET PROCEDURE TO
*QUIT
*** Sure Not Further Execution, escape Error ***
PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
	DEBUGING=.F.
	CLEAR
	=MessageBox(	'Error number:	' + LTRIM(STR(merror)) + chr(13) +;
				'Error message:	' + mess + chr(13) +;
				'Program:		' + mprog + chr(13) +;
				'Line number:	' + ALLTRIM(STR(mlineno)) + chr(13) +;
				'Error code:' + repl(chr(13),2) + [> ] + mess1;
				, 48, "Error Message Found!!")
*	ON ERROR
	IF DEBUGING
		SUSPEND
		DEBUG
		DEBUGING = .F.
	ENDIF
*	RETURN .F.
ENDPROC

PROCEDURE objErr
PARAMETER nError, cMethod, nLine, ErrObject, Mess, Mess1
messagebox(	'Error number:	' + LTRIM(STR(nError)) + chr(13) +;
			'Error message:	' + mess + chr(13)+;
			'Object:		'+fullname(ErrObject)+chr(13)+;
			'Method:		'+cMethod+chr(13)+;
			'Error Line:	'+ltrim(str(nLine))+CHR(13)+;
			'Error Code:	'+repl(chr(13),2) + [> ] +Mess1;
			,48, 'Object Error' )
ENDPROC
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform