473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to import a data to executable program?

I want to import some sound files to executable file. And also I want
to know that imports adress and size. How can I import a data to
executable file?

Thanks
Kervan ASLAN

Jul 22 '07 #1
5 3144
On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo***@mynet.comwrote in
comp.lang.c:
I want to import some sound files to executable file. And also I want
to know that imports adress and size. How can I import a data to
executable file?
C doesn't "import" anything. If you want to read the data from these
files, open your C reference and look up the functions fopen() and
fread(). You would probably need to use binary mode for sound files.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Jul 23 '07 #2
On 23 Temmuz, 05:24, Jack Klein <jackkl...@spamcop.netwrote:
On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo...@mynet.comwrote in
comp.lang.c:
I want to import some sound files to executable file. And also I want
to know that imports adress and size. How can I import a data to
executable file?

C doesn't "import" anything. If you want to read the data from these
files, open your C reference and look up the functions fopen() and
fread(). You would probably need to use binary mode for sound files.

--
Jack Klein
Home:http://JK-Technology.Com
FAQs for
comp.lang.chttp://c-faq.com/
comp.lang.c++http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
But can show some images on buttons(I talk about gtk and Borland C++)
And we don't read an external file. I think those image files included
to Executable file. I know that fopen, and fread uses for external
files.

Jul 23 '07 #3
fobus wrote:
On 23 Temmuz, 05:24, Jack Klein <jackkl...@spamcop.netwrote:
>On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo...@mynet.comwrote in
comp.lang.c:
I want to import some sound files to executable file. And also I want
to know that imports adress and size. How can I import a data to
executable file?

C doesn't "import" anything. If you want to read the data from these
files, open your C reference and look up the functions fopen() and
fread(). You would probably need to use binary mode for sound files.

--
Jack Klein
Home:http://JK-Technology.Com
FAQs for
comp.lang.chttp://c-faq.com/
comp.lang.c++http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Please don't quote signature blocks unnecessarily.
But can show some images on buttons(I talk about gtk and Borland C++)
And we don't read an external file. I think those image files included
to Executable file. I know that fopen, and fread uses for external
files.
This will be specific for each platform or GUI toolkit. Posting to a
platform or toolkit specific group would be better.

Jul 23 '07 #4

"fobus" <fo***@mynet.comwrote in message
It's trivial to write a "dumptoC" program. If you on my website you'll see a
csvtoC struct program that does essentially the same thing, but with
tablular data instead of flat objects like sound files.

You just print the data as a global C array, and it can then be added as a
source file to the program. This is one case where use of a global is
necessary.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
Jul 24 '07 #5
On 7 23 , 7 22 , fobus <fo...@mynet.comwrote:
I want to import some sound files to executable file. And also I want
to know that imports adress and size. How can I import a data to
executable file?

Thanks
Kervan ASLAN
For Windows Applications, there is an easy way.
You can use resources.
Add your sound files to the resource file. And when you need to use
it, you can use LoadResource(to load it), LockResource(to get the
address) and SizeofResource(to get the size) functions.

However, this way is not available on other platforms.

Jul 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brian Hlubocky | last post by:
I'm have a fairly simple (in terms of COM) python program that pulls info from an Access database and creates Outlook contacts from that information. It uses wxPython for gui and works without...
4
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as...
4
by: Steve | last post by:
I'm trying to run a Python program on Unix and I'm encountering some behavior I don't understand. I'm a Unix newbie, and I'm wondering if someone can help. I have a simple program:...
3
by: SpIcH | last post by:
Hi All, This is all about protecting my data in Executable file. I have developed a program in Visual Basic .NET 2002. I have many questions in mind... please help me to complete my project. ...
3
by: archaegeo | last post by:
I am getting started in Python, and I have looked on both the stackless page and python.org and cannot find the answer to what I think is a simple problem. If I start the python command line or...
1
by: Nick Craig-Wood | last post by:
I've been dumping a database in a python code format (for use with Python on S60 mobile phone actually) and I've noticed that it uses absolutely tons of memory as compared to how much the data...
2
by: WP | last post by:
Hello, I've just started to work with DB2 (using the express edition version 9.5 under windows vista) and I'm accessing it through a java program (my java's very rusty). The java program loads the...
11
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
27
by: c.lang.myself | last post by:
i just got to know there are three different sections in which we can divide our program *Text section *Data section *Bss i think text section contain our code,data section include heap,stack...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.