Solved

Resource Help needed...

Posted on 1998-09-12
7
129 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 20 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
Industry Leaders: 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!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month3 days, 11 hours left to enroll

630 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