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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executable name

Status
Not open for further replies.

scienzia

Programmer
Feb 21, 2002
160
0
0
IT
Hi,

I made an MFC application that sends a file through the serial port. I put the file in the resources.

I would like recompile my application with various files, and make the executable name "tell" which file it downloads.

Is there a way to make the executable file name depend on some define?
 
Hi,
i don't understand what you mean. please,explain
it exactly.
tnx
 
Imagine I have 3 files:
a.txt
b.txt
c.txt

I made a program that is able to send a file on the serial port.
The file sent is not chosen by the user but it is fixed in the program.

I would like to have
MyAppA that sends the file a.bin
MyAppB that sends the file b.bin
MyAppC that sends the file c.bin

Now I do it by loading file a.bin in the resources, compiling the application and renaming the executable to MyAppA, then I take away from the resources the file a.bin, replace it with b.bin and compile it again,... and so on.

I'm sorry if it seems a bit a mess, but the reason I do it this way is that I use this application to load software inside an hardware component connected to the serial port, and it is very important for me to load the same software on all the components.

I hope now I explained it better, feel free to ask if you have any question....



 
Would it be possible to:
1. Create an executable that took the file name(s) as a parameter and loaded that file.
2. Create a second executable that called the first, specifying the file(s) to load.

If so you would have a lot of flexibility. You could, for instance, point the second executable to a directory and have the first executable load all of the files in that directory with a specified extension.

Just a thought,

John
 
This is a very good way, thankyou very much.

I already thought of a way to force loading a certain file:

the loader takes 2 parameters: one is a loader, and the other is a sort of CRC of the file, so the user can't download any file he wants.....because he doesn't know the CRC value.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top