Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing files from code within a VFP executable? 1

Status
Not open for further replies.

GuitarSlayer

Programmer
Dec 16, 2004
29
0
0
GB
Hi,

Firstly don't ask me why I want to do this, all I can say is that I have been asked if its possible to accomplish.

Here we go, is it possible to copy out a bmp file from a VFP exe to disk?

As you have probably guessed the bmp is included in the exe at build time.

Any help on this would be much appreciated.

Thank you.
 
Um sorry my title for this problem is misleading it should read 'Accessing files from within a VFP executable from code'
 
Yes, it is possible, just use:
<pre>
STRTOFILE(FILETOSTR([MyBMPIncludedInVFPExe.BMP]),[MyBMPOnDisk.BMP])
</pre>

Borislav Borissov
 

Borislav's code works - if considered desirable, you can also use it to distribute miscellaneous files other than image files.

You can check for the existence and/or properties of the required files as the VFP application initialises and extract them from the .exe if they have been deleted or modified. [smile]

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].net
PDFcommander[sup]tm[/sup].com
 
Geoff,

No I don't have any source code yet I'm just testing a theory,
basically the bmp sits in the exe, all I'm trying to accomplish is to copy the bmp from the exe onto disk, via foxcode, in this particular instance the foxcode would be a prg.

Thanks for your interest.
 
"Is it possible to copy out a bmp file from a VFP exe to disk?"

There are a number of Shareware/Freeware programs out there which will 'rip' a copy of the icon image from EXE files.

Google icon rip exe and you will get a number of search responses.

Good Luck,
JRB-Bldr
 

JRB-Bldr,

But, surely, that would apply to icons, as opposed to bitmaps. The point is that Windows has a way of storing icons (ICOs) in EXEs, whereas the ability to embed any file type, such as BMPs, is special to FoxPro.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike - you are correct.

If the BMP file (such as a button image BMP file, etc.) is included with the Project and compiled into the EXE then the Shareware tools will not work.

I mis-understood what it was that he was trying to extract from the EXE file.

JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top