Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve images from EXE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01250756
Message ID:
01250838
Vues:
39
This message has been marked as the solution to the initial question of the thread.
Hi Bo,

> what code would you recommend that would determine if the file is embedded vs. on disk?

I've used ADIR() in the past, but SYS(2000) seems just as appropriate.

>From what I can tell, these functions can see the embedded resource:

There are three groups of commands and functions. Some cannot access embedded files at all, some only those stored in the project root and some those in sub folders, as well. Unfortunately I haven't done any systematic testing on these statements. It's more like little piece of knowledge like "Don't use COPY FILE" for embedded files", "use random file names for developer projects", "copy images to the temp directory when using ActiveX controls", and the like.

>She is also using STRTOFILE(FILETOSTR()) as you are using here. Is there a point where size could be come an issue that FREAD/FWRITE ing blocks would be better?

FILETOSTR() is about the best command. COPY FILE doesn't work on embedded files. FREAD() has problems with larger files and is slower. FILETOSTR() can even read files beyond the 16 MB limit, even though I wouldn't rely on it. Albeit this limit shouldn't be an issue with embedded files, as it's unlikely someone embeds a 20 MB picture file..
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform