Information générale
Catégorie:
Codage, syntaxe et commandes
>I'm owner of VS 6.0 and most used tools from them is VFP 6 (at least, post of Mr. L.Miller about transparency forms in VFP etc. was one of the main reason to buy this version, thanks Larry :-) ). With VFP I working almost 5 years and I'm find out I'm enough good to use it. I'm incurious to know is there a way that with VFP produced *.EXE could open himself without error and write something inside? For example, let I have got an "File HexEditor" written in VFP 5 or 6. I like to open this EXE with himself and change something. It's impossible.
>I'm trying to solve it with usual low-lewel file function (FOPEN(.... etc..) but like result for handler of the open file is always returning -1 (error). Maybe some API call? Or...?
In general, any EXE (even on a server) is write-protected once someone is running it.
Create 2 EXE'S ... Make it so that the second EXE (the "modifier") can only be called by the "main" EXE and must be passed a "secret" parameter. Maybe the second EXE is loaded from a Memo in a table.
Have the main EXE start the second EXE; then have the second EXE go into a "wait state" for a "short period" using (maybe) INKEY() or a timer; have the "main" EXE quit.
The second EXE modifies the main EXE; it then starts the main EXE; the second EXE now quits. The main EXE (after a "short period/wait"), deletes the second EXE after having determined that "itself" was modified (otherwise it would attempt to load the second EXE, etc).
Or something like that ... :)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement