By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

embed s file in exe

P: n/a
Dear all,

I want to embed a motorola s file in my exe file using Visual
C++.net,
and then I can use the data in the Motorola file. How should I
do?
I am urgently need your help.
Thanks a lot.

Oct 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Robert" <wa*********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Dear all,

I want to embed a motorola s file in my exe file using Visual
C++.net,
and then I can use the data in the Motorola file. How should I
do?
I am urgently need your help.
Thanks a lot.
Why do you need to "embed" a file in an executable? Why not just write your
executable so that it opens and reads the file?

Anyway, if you really need it to be part of the executable for some reason,
you might be able to create a resource out of it which you can import into
your project and which will then compile into the executable. But resources
are specific to your operating system (Windows, in this case), and importing
them into a VC++ project is specific to VC++. You should ask in a VC++ or
other microsoft newsgroup.

(By the way, I have no idea if your "s" file, whatever that is, is
proprietary data, but if it is, you'd better check on whether it's ok to
distribute it before distributing your executable.)

-Howard


Oct 4 '06 #2

P: n/a
Howard wrote:
Why do you need to "embed" a file in an executable? Why not just write
your executable so that it opens and reads the file?
Anyway, if you really need it to be part of the executable for some
reason, you might be able to create a resource out of it which you can
import into your project and which will then compile into the executable.
But resources are specific to your operating system (Windows, in this
A portable way is to write a program that reads the executable in binary
mode and generates some like:

const char filecontent []=
{
byte1, byte2 ...
};

Add a header file with the extern declaration for filecontente if needed,
add other variable with the file lenght if you need it, compile and link
with the main program, and voila.

--
Salu2
Oct 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.