Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exe size bloat???
Message
 
 
À
26/08/2006 10:34:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01148810
Message ID:
01149126
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Sometimes there are large files included in your project that you are not aware of (bitmaps etc).

I use this code to detect any large files that might cause the EXE to bloat:
CREATE CURSOR cuFileSize (cuType C(25), cuSize N(14), cuFileName C(200))
FOR EACH loFile IN _VFP.ActiveProject.Files
	IF loFile.EXCLUDE = .T.
		LOOP
	ENDIF
	*
	DO CASE
		CASE loFile.TYPE = "V"
			*-- Classlib
			*-- Get the VCX and VCT files.
			lnFile1 = ADIR(laFile1,loFile.NAME,"HS")
			lnFile2 = ADIR(lafile2,FORCEEXT(loFile.NAME,"VCT"),"HS")
			lnSize = laFile1[1,2] + laFile2[1,2]
			lcFileType = "Classlibrary"
		CASE loFile.Type = "R"
			*-- Report.
			lnFile1 = ADIR(laFile1,loFile.NAME,"HS")
			lnFile2 = ADIR(lafile2,FORCEEXT(loFile.NAME,"FRT"),"HS")
			lnSize = laFile1[1,2] + laFile2[1,2]
			lcFileType = "Report"
		CASE loFile.Type = "B"
			*-- Label.
			lnFile1 = ADIR(laFile1,loFile.NAME,"HS")
			lnFile2 = ADIR(lafile2,FORCEEXT(loFile.NAME,"FRT"),"HS")
			lnSize = laFile1[1,2] + laFile2[1,2]
			lcFileType = "Label"
		CASE loFile.Type = "D"
			*-- Table.
			lnFile1 = ADIR(laFile1,loFile.NAME,"HS")
			lnFile2 = ADIR(lafile2,FORCEEXT(loFile.NAME,"CDX"),"HS")
			IF lnFile2 = 0
				lnSize2 = 0
			ELSE
				lnSize2 = laFile2[1,2]
			ENDIF
			lnFile3 = ADIR(lafile3,FORCEEXT(loFile.NAME,"FTP"),"HS")
			IF lnFile3 = 0
				lnSize3 = 0
			ELSE
				lnSize3 = laFile3[1,2]
			ENDIF
			lnSize = laFile1[1,2] + lnSize2 + lnSize3
			lcFileType = "Table"
			*
		CASE loFile.TYPE = "P"
			*-- Program file
			lnFile1 = ADIR(lafile1,FORCEEXT(loFile.NAME,"FXP"),"HS")
			lnSize = laFile1[1,2]
			lcFileType = "Program"
		OTHERWISE
			*-- Any other file
			lnFile1 = ADIR(laFile1,loFile.NAME,"HS")
			lnSize = laFile1[1,2]
			DO CASE
				CASE loFile.Type = "K"
					lcFileType = "Screen"
				CASE loFile.TYPE = "x"
					lcFileType = "Picture"
				CASE loFile.TYPE = "L"
					lcFileType = "Library"
				CASE loFile.TYPE = "T"
					lcFileType = "Textfile"
				OTHERWISE
					lcFileType = "Other"
			ENDCASE
	ENDCASE
	*-- Add the file info to the cursor.
	INSERT INTO cuFileSize VALUES ;
			(lcFileType, lnSize, loFile.NAME)
ENDFOR
*
INDEX ON cuSize DESCENDING TAG cuSize
LOCATE
SUM cuSize TO pnTotalSize
COUNT TO pnTotalCount
LOCATE
BROWSE
>Having created numerous compiled applications as small as 179kb is size, (most are under 8mb) I now have a rather basic application including fewer than 10 forms, under 2,000 lines of .prg code, and a simple menu which uses 4 free tables with fewer than 300 records... it compiles to an exe over 24mb in size.
>
>Is there any way to check the project for extraneous matter? What determines the size of the exe?
>
>Thanks.
>
>
>dg
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform