Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

How to create a resource using brcc32.exe? Find similar branches


Delphimun   (2001-12-15 13:11) [0]

I need to create a resource with wav-th for example using brcc32.exe, but I don’t know how



vasco   (2001-12-15 15:12) [1]

Draw a .rc file with the line:
WAVRES BINARY myfile.wav
and connect it to the project (Add to Project ...)
Then you access it using the FindResource, SizeofResource, LoadResource functions, you get a pointer to an array of bytes in memory at the output.
You can do whatever you want with him.



vasco   (2001-12-15 16:41) [2]

And here is another in kuliba1000.chm:

I'm trying to play a wave file when I click on the button of my Delphi application. I installed the sound file and used the PlaySound () function API call, but I would like to put it into the application resource, i.e. embed it into an exe file and play it from there.
First, you need to compile the required resource (for example, using the Resource Workshop) and include your WAVE file there. Then to call and play it, use the following code:


-------------------------------------------------- ------------------------------
var FindHandle, ResHandle: THandle;

ResPtr: Pointer;
begin

FindHandle: = FindResource (HInstance, "<Your resource name>", "WAVE");
if FindHandle <> 0 then begin
ResHandle: = LoadResource (HInstance, FindHandle);
if ResHandle <> 0 then begin
ResPtr: = LockResource (ResHandle);
if ResPtr <> Nil then
SndPlaySound (PChar (ResPtr), snd_ASync or snd_Memory);
UnlockResource (ResHandle);
end;
FreeResource (FindHandle);
end;
end;

After a while I found the best solution (in Delphi 3):



-------------------------------------------------- ------------------------------
PlaySound ("S1", HInstance, SND_RESOURCE or SND_ASYNC);

where S1 is the sound ID.

This single line of code itself searches, downloads, blocks, unlocks and frees a resource.




vasco   (2001-12-15 16:44) [3]

Sorry, in the first version, the line in the .rc file, apparently, should look like this:
WAVRES RCDATA myfile.wav
and you can try this:
WAVRES WAVE myfile.wav
Try, experiment ...



MARcoDEN   (2001-12-15 17:31) [4]

Create a file nn.rc containing the line

CHECK WAV "340.avi"

Then compile using the brcc32.exe resource (RES):
brcc32.exe c: \ nn.rc
and connect in the program {$ R nn.res}



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top





Memory: 0.56 MB
Time: 0.024 c
1:22163
Marina
2001-12-20 16:29
2002.01.08
Month names


1:22173
Petyun
2001-12-20 19:33
2002.01.08
Component installation


1:22058
$ Hic0
2001-12-16 11:49
2002.01.08
TTreeView and TListView


3:21958
bk
2001-12-05 19:15
2002.01.08
Pomogite kto moget ado unikal nomer


4:22466
Type
2001-10-31 15:21
2002.01.08
And also, how to limit the plane of the mouse movement to the shape borders?





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish