Solved

Resource Help needed...

Posted on 1998-09-12
7
122 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
  • 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now