Solved

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

Posted on 2004-10-19
17
686 Views
Last Modified: 2013-11-25
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.
0
Comment
Question by:sapreen
  • 6
  • 3
  • 3
  • +1
17 Comments
 
LVL 8

Expert Comment

by:AaronReams
Comment Utility
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
0
 
LVL 12

Expert Comment

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

0
 

Author Comment

by:sapreen
Comment Utility
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:)
0
 
LVL 8

Expert Comment

by:AaronReams
Comment Utility
The RealAudioClass should play both audio and video.  

I'll look into helping you out with VC6.

Good luck,
Aaron
0
 

Author Comment

by:sapreen
Comment Utility
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
0
 
LVL 6

Expert Comment

by:Amritpal Singh
Comment Utility
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:sapreen
Comment Utility
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++
0
 
LVL 6

Accepted Solution

by:
Amritpal Singh earned 250 total points
Comment Utility
if u have  installed the real player u should find the corresponding control in the "Registered ActiveX contols" list . when i installed real player 10 ,the control named Real Player G2 control was listed in the the list
in the path field ,i can see the dll as rm0c3260.dll
so plz check again
0
 

Author Comment

by:sapreen
Comment Utility
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
0
 
LVL 8

Assisted Solution

by:AaronReams
AaronReams earned 250 total points
Comment Utility
Hi Sapreen,

It sounds like you are making progress.  So are you able to play files like the ram link I sent you in the code?

I haven't had a chance to try this out in VC6 but I think this is what you need to do...

// Import the library to create the tlb file
#import <rm0c3260.dll>

// Create a member variable in your dialog
IRealAudioPtr iPtr;

// Play the file in your dialog
iPtr->SetSource(_bstr_t("http://www.kqed.org/w/streamingfiles/kqed_real.ram"));
iPtr->DoPlay();
0
 

Author Comment

by:sapreen
Comment Utility
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.
0
 
LVL 6

Expert Comment

by:Amritpal Singh
Comment Utility
administrator should split points here ,as the asker is quite satisfied with the posts.
even he has asked to increase points of the question
0
 

Author Comment

by:sapreen
Comment Utility
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

763 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

16 Experts available now in Live!

Get 1:1 Help Now