Link to home
Start Free TrialLog in
Avatar of sapreen
sapreen

asked on

Playing Real Media (.rm) files in vc++ MFC or Platform SDK

I would like to play Real Player Media(.rm) files in my application and am not sure as to how to acheive this task. I would really appreceate some tips as to how to go about it. I would like to know if it is possible to acheive this with Video for Windows(VFW) or Directx or probably by using some ActiveX control and if so then which would be the easiest option and the pros and cons  of these options. Right now I am not even sure as to how to start  solving this task so any tips and feedback would be graeatly appreceated.
Avatar of AaronReams
AaronReams

Hi there,

You're question looked interesting so I looked into it a bit.  The following is C# code but this was how I was able to get it to work.  It should give you a good idea of how to do it in MFC.

First I added a reference to the COM object:
"Real Player ActiveX Control Library"

Then I was able to instantiate and use a RealAudioObject to play a real audio files using the following C# code.

private RealAudioObjects.RealAudioClass rac = null;
rac = new RealAudioObjects.RealAudioClass();
rac.Source = @"http://www.kqed.org/w/streamingfiles/kqed_real.ram";
rac.DoPlay();

I don't have VC6 in front of me so I can't tell you exactly how to do it.  However it should be quite similar to the code I've posted here.  Once you add the COM object to your project, intellisense should give you the list of members and methods available to use.

Good luck.  If you have a lot more trouble I'll take a look at this code when I get home and have VC6 in front of me.

Cheers mate,
Aaron
use activex control installed by realplayer to play it.
here is a similar case, play flash,
http://www.fruitfruit.com/vc/activex/flsh.cpp

Avatar of sapreen

ASKER

Aaron and Onega Thank You both for your prompt responses.

Both your methods seem to suggest the use of COM and as I have sparingly used COM I would need probably a days time to refresh my memory on COM. As soon as I am done doing that I will test out your approaches.

Aaron in the mean while if you could give me some tips specific to VC++6 then it would be of great help. The final objective is to be able to play Real Movie file not just audio. I hope this approach is consistent with that too.

Thanks once Again:)
The RealAudioClass should play both audio and video.  

I'll look into helping you out with VC6.

Good luck,
Aaron
Avatar of sapreen

ASKER

Hi Aaron
I have Real Player 10.0 installed on my system. To start off in VC6 I created a Dialog app with tha app wizrard and Enabled the ActiveX support. I then went to the Menu (Project->Add To Project->Components and Control)     and went through the list of all the components but I cant seem to find RealAudioClass in the list. Can you give me specific details of the files and tell me if it is an OCX file or what or else how to go about initializing the class.
Regards
Sapreen
Avatar of sapreen

ASKER

I tried registering the ActiveX dll RMOC3260.DLL by using the command (e:\windows\system32regsvr32 rmoc3260.dll)  and got a Success message. However when I went to VC++ Menu (Project->Add to Project->Components and Control) I could not find any Registered Active X control corresponding to the above DLL.
However when I tried the same with Helixprodctrl.dll of Helix Producer DNA 10.0 SDK i was successfully able to register it and also find an ActiveX component HELIXPRODUCERCTRL CLASS listed in Registered Components and Controls So why isnt the same happening with RMOC3260.DLL.

I dont know if I am on the right track but I have a feeling that a Real Player Activex controll will suffice my need (which is only to playback .rm files and not convert or record them) and thus would not have to look into Helix Porducer.

Please give me your Feedback and suggesstions asto how to go about acheiving this task of playing a .rm file in a dialog based application in vc++
ASKER CERTIFIED SOLUTION
Avatar of Amritpal Singh
Amritpal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sapreen

ASKER

Thanks Amrit
Yes I installed the latest download of Real player and finally got the Real Player G2 control in VC++. Atleast now I have got something to work and code with. However the original problem is still left to be talckled and I have gone through your link but unfortunately it does not deal with playback of .rm files and it seems to be more concentrated on real/Helix producer.

I am doing some further research on how to go about it and will posting comments on any usefull information since there does not seem to be a question or tutorial simillar to this on the forum.

All of you(Aaron, Onega, Amrit), your further inputs will be greatly appreceated as the problem still lies wide open and in the initial stages towards finding a solution.

I know this forum is not all about points but from my side I assure you all that you all will be compensated with points for your effort  depending on the degree of contribution. As a gesture of good will I am also increasing the points from 500-850
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sapreen

ASKER

Hi Aaron
Ill try your approach and get back to you. As of now I was trying to get the appropriate ActiveX Container included in my project which I finally got done, so I guess today I will be able to get something done by using the container in my dialog box.
Thanks
Sapreen

I am not sure as to how to increase the points because I can not find any option to increase the points by
logging in->switching to expert mode->My open questions and then Viewing this question.
So if an administrator is viewing this page help me increase the points from 500 to 850 or any one of you could also tell me how to do so.
administrator should split points here ,as the asker is quite satisfied with the posts.
even he has asked to increase points of the question
Avatar of sapreen

ASKER

I would not say that I am completely satisfied with the responses however as I said please increase the points to 850 and split them equally against amrit and aaron. I do intend to post a step by step procedure of getting Real player to work in a modal dialog MFC as promised but do to time contraints and deadlines I am not able to do so right away.