Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resource Help needed...

Posted on 1998-09-12
7
Medium Priority
?
131 Views
Last Modified: 2012-05-04
How can I put Wave File in resource and
then load it with Delphi 3.0 Application?
0
Comment
Question by:kaloyan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 1

Expert Comment

by:duke_n
ID: 1339539
Why don't you load it as it is?
0
 
LVL 10

Accepted Solution

by:
viktornet earned 80 total points
ID: 1339540
Try to do the following:
1. Create a text file with .RC extension;
2. Write thie single line into it
    MyWavFile WAV_RESOURCE "WavFileName.wav"
3. Save it and compile it with BRCC32.EXE which will create a .RES file;
4. Include the .RES file into your project file like this {$I MYWAVRES.RES},
for example; and
5. Use this routine to load it

function LoadWavResource : pointer;
var  resrc           : HRSRC;
       global          : HGLOBAL;
       ResrcSize    : DWORD;

begin
        resrc:= FindResource(Application.Handle,'MyWavFile','WAV_RESOURCE');
        if resrc = 0
           then Result:= nil
           else begin
              global:= LoadResource(Application.Handle,resrc);
              if global = 0
                 then Result:= nil
                 else begin
                    ResrcSize:= SizeofResource(Application.Handle,resrc);
                    if ResrcSize = 0
                       then Result:= nil
                       else Result:= LockResource(global);
                 end;
           end;
end;
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339541
Raboti li tazi procedura???

Regards,
Viktor Ivanov
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:kaloyan
ID: 1339542
Yes it works perfect. Thanks!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339543
No prob! You are from Bulgaria, right??? I've seen only a few Bulgarians around here =)

Regards,
Viktor Ivanov
0
 

Author Comment

by:kaloyan
ID: 1339544
Yes I am from Bulgaria!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339545
Ok, thanks for answering :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question