Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Corrupt compiled exe
Message
 
À
02/02/2006 10:09:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01092842
Message ID:
01092871
Vues:
13
Hi Jens,

What do you mean, "corruption" and "fail"? Any errors or what?
Do you have any on error routine in your application?

In any case I doubt that analyzing characters in exe file you will get something useful: it is not a text or database file.

The error itself should tell you what this error is, and the custom on error routine should tell you in what module it happened and on what line.



>Hi!
>
>I get some sort of corruption in a fairly large exe, which is probably caused by a corruption in a class library or a scx. The worrying part is that compiling the project (with recompile all) doesn’t give any indication that anything is wrong. When running the application, it will fail some times on some machines. It seems there is a higher chance of getting the error when the exe is started from a shortcut than when starting by a double-click. This is the first time I’ve seeing this in Vfp.
>
>I haven’t yet found which class library that is causing this, but this is not really my question. What I’m trying to figure out is if there is a way to check a vfp exe file if there any characters that are not supposed to be present in a compiled exe? The idea is to have a small routine that scans an exe and checks to see if there are any characters or combination of characters that never should occur in a compiled exe. It would be reassuring to have a test to run before installing a corrupt exe on 400 computers, which I did the other day.
>
>The small test program below reads each character from an exe and stores the ansi value in a table. Are there any values that should never be there? I know this a long shot, but it would be interesting to see if anybody has some intimate knowledge of the structure of a compiled exe.
>
>
CLOSE ALL
>CLEAR ALL
>
>llOldAutoYield = _VFP.AutoYield
>lcOldSafety = SET("SAFETY")
>lcFile = GETFILE("EXE", "File to test")
>
>IF EMPTY(lcFile)
>	RETURN
>ENDIF
>
>SET SAFETY OFF
>_VFP.AutoYield = .T.
>
>CREATE TABLE Distrib (Chars I, CharCount I)
>INDEX ON Chars TAG Chars
>SET ORDER TO
>
>lcData = FILETOSTR(lcFile)
>
>lnCount = LEN(lcData)
>
>FOR lnI = 1 TO lnCount
>	IF MOD(lnI, 20) = 0
>		WAIT WINDOW NOWAIT TRANSFORM(lnI)
>	ENDIF
>
>	lcChar = SUBSTR(lcData, lnI, 1)
>	lnAsc = ASC(lcChar)
>	IF !SEEK(lnASc, "Distrib", "Chars")
>		INSERT INTO Distrib (Chars) VALUES (lnAsc)
>	ENDIF
>	REPLACE CharCount WITH CharCount + 1 IN Distrib
>	IF lnI >= 1000
>		EXIT
>	ENDIF
>ENDFOR
>
>_VFP.AutoYield = llOldAutoYield
>IF lcOldSafety = "ON"
>	SET SAFETY ON
>ENDIF
>
>SET ORDER TO Chars
>BROWSE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform