• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

load resource file

i want to insert a avi file for the mediaplayer as a resource file. I already managed to make the resource file, but i don´t know, how to load it in the mediaplayer.
Help wanted!
0
brausy
Asked:
brausy
  • 2
  • 2
1 Solution
 
rwilson032697Commented:
You have to write it to a file then give it to the mediaplayer, like this:

var
  TheStream : TResourceStream;

begin
  TheStream := TResourceStream.Create(Application.Handle, 'THEAVIRESNAME', RT_RCDATA);
  TheStream.SaveToFile('MyAvi.AVI)
  TheStream.Free

  MediaPlayer1.FileName := 'MyAvi.AVI';

etc...

Cheers,

Raymond.
0
 
brausyAuthor Commented:
Actually I want to burn the program on Cd so I can´t create a file. And the program can´t fin the resource file - the resource is in ANIMATION and called Animation_1. Help

0
 
rwilson032697Commented:
Well, you could write it to the windows temp directory. Alernatively, since you're burning a CD why not just put the AVI down as a separate file?

Raymond.
0
 
brausyAuthor Commented:
is there no way to start the file from the ram, instead of writing it to disk
0

Featured Post

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now