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.57 MB
Time: 0.043 c
1-22062
Alexander
2001-12-19 00:17
2002.01.08
How can I add N days to a certain (TDateTime) date?


1-22245
T2
2001-12-16 07:12
2002.01.08
Gost & best crypt


3-21910
Wladimir
2001-12-04 08:01
2002.01.08
Number of entries in the table?


1-22168
Yegor Bulychev
2001-12-20 21:59
2002.01.08
myedit.exe param ???


1-22176
Serg5
2001-12-20 14:57
2002.01.08
Again, the problem with the text: I display Image1.Canvas.TextOut, but under the text itself is a white runner. Is it possible if you do not remove (just put the letters), then at least make the runner black.





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 Español 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