Store files within EXE ??
What is the best way to embed binary file information into the program while in development mode, so that it gets compiled into the EXE ???
For example: I write a lot of programs that use IO.DLL, and because I'm strange, I prefer to keep the DLL in the install directory of the program and leave it unregistered in the system, which does work. If I wanted to embed that into the EXE so that when the program starts, it checks if the DLL has been corrupted or lost, then will spawn a new one (Open for binary as #1, Put #1.....). This may be a poor example, but I can remember a number of times that I would have liked to embed files in the EXE so that they could be created at will.
Another example would be having large binary arrays for lookup tables without trying to define it with Array(12,65,23,98,34,114,.....). The table could be dumped to a file or possibly read from the containing control.
If you have ever worked with Assembly or Firmware programming, you know that it is relatively easy to store misc. raw data into the program and read it from memory as a reference. I guess this is sort of what I was looking for.
I don’t know what would happen if you cut/paste the data to a hidden text box of a form while in the IDE - I haven’t tried it yet, but I would assume that there would be a problem reading back the binary information from the textbox and get it byte for byte perfect.
Has anyone tried this before ?? Is there a control that could work as a PictureBox for binary data ?? (Actually come to think of it, I guess you could create a bitmap with the pixels representing the binary data of a file, and use a PictureBox)
Any ideas on a clean way to do this ??? What ever the solution, I would like to be able to access the data from code.
Re: Store files within EXE ??
Hi,
Did you ever get a solution ?
Re: Store files within EXE ??
Why would you want to store large amounts of data in an exe making it unnecessarily huge when a simple data file will do?
Re: Store files within EXE ??
There's a few reasons why someone would want to store data within an EXE rather than a data file, least of all security. Assuming the data was encrypted wherever it was stored in the file, it would be next to impossible to recognise and retrieve from the file if stored well :-)
Another obvious reason is so that there's just one file rather than a bunch of them, and it'd run standalone
Re: Store files within EXE ??
VB Standalone... That's an oxymoron!!! I would be pissed to have a program that took up large amounts of memory just to store data that it MIGHT one day need to use. There are better ways to use memory and that is not one of them.
Re: Store files within EXE ??
You calling me a moron? :-)
You know the old saying...horses for courses...you might not want to store the data within the EXE, but he does...I personally wouldn't either, but in this case... :-)
As long as programmers give him possible alternative solutions while giving him a possible way to do what he wants, we're helping