473,756 Members | 8,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3173
On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo***@mynet.co mwrote 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.l earn.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...@spam cop.netwrote:
On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo...@mynet.co mwrote 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.l earn.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...@spam cop.netwrote:
>On Sun, 22 Jul 2007 16:22:35 -0700, fobus <fo...@mynet.co mwrote 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.chtt p://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.co mwrote 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.co mwrote:
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
3981
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 problems. I want to be able to distribute this program using py2exe, but I am having some problems. I am using a simple setup.py like in the documentation for the py2exe tool and everything compiles ok, except that when I run the exe, I get an...
4
12726
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 though the file may be too big! When I try to do it via command line: mysql -u root --host=localhost printing < ./printing.txt It eventually errors out with a "syntax error on line X" and only about
4
1786
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: ____________________________________________ #! /home/fergs/python/bin/python import sys, os import cx_Oracle
3
4101
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. 1. I have very much data to be incorporated into the executable file. I have to add much data into my developed program into 2 Combo Boxes and 1 List Box control. For that i have created an xml element with all of the
3
2983
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 idle, i can If I start pythonwin I get the following error ....No Module named Stackless Any help?
1
3015
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 structure actually needs once it is loaded in memory. The programs below create a file (z.py) with a data structure in which looks like this -- z.py ---------------------------------------------------- z = {
2
7107
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 driver, connects and tries to create two tables. That works just fine. Then it tries to import data into one of the tables but it seems I can't use an import command with Statement.execute() because an exception is thrown if I attempt to do this....
11
3820
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 doesn't seem to work. The code below is what I'm trying to use. Anyone see any obvious errors? or have any hints/pointers? regards, Igor float floatRead = 0;
27
13577
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 (?) etc. Can any body throw light on Bss section...
0
9384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9212
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9973
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6473
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5247
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2612
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.