Pls help with embedding wmp in a non-dialog mfc view

Hi,

I'd like to add mpeg, avi, and wmv playback capability to my mfc app.  I
thought that this would be quite simple if I decide to use Windows Media
Player ActiveX instead of DirectShow filtergraph.  Unfortunately that did
not happen (i.e. the 'simple' part).  First I struggled with Visual Studio
..NET - inserting wmp into the project did not generate CWnd derived wrapper
class (as stated in sdk docs).  Instead it generated COleDispatchDriver
derived class.  I did not want to waste any time on typing (clsid, create,
etc.) so I decided to use VC6 and generated CWnd derived wrapper classes.
Does anyone know why VS .NET does not generate CWnd derived class for wmp?

But my biggest problem is that the player control occasionally hangs the
application.  When this happens the CPU usage stays at 100%.  I think that
the problem occurs mostly at the time when the player switches between
different file types (e.g. from mpg to wmv).

My application does not play media files continuously.  It is event driven
and might play few clips in a row and then no clips for few minutes.  When a
given clip is being played the app does not 'know' if another clip will
follow immediately or not.

All examples that I've seen so far for WMP and mfc were based on the player
control embedded in a dialog box.

Could anyone please give me an example of a working code or point me to a
proper documentation?

The code I use to control the player looks something like this:

// Setup/creation
m_wmpPlayer.Create(NULL, WS_VISIBLE, CRect(0, 0, 0, 0), m_pParentWnd,
m_nControlID);
m_wmpPlayer.SetEnableContextMenu(FALSE);
m_wmpPlayer.SetEnabled(TRUE);
m_wmpPlayer.SetFullScreen(FALSE);
m_wmpPlayer.SetWindowlessVideo(FALSE);
m_wmpPlayer.SetUiMode(L"none");
m_wmpPlayer.SetStretchToFit(TRUE);
CWMPSettings wmpSettings = m_wmpPlayer.GetSettings();
wmpSettings.SetAutoStart(FALSE);
wmpSettings.SetEnableErrorDialogs(FALSE);
wmpSettings.setMode(L"showFrame", TRUE);

.....

// Playback start
m_wmpPlayer.MoveWindow(rRect, FALSE);
m_wmpPlayer.SetEnabled(TRUE);
m_wmpPlayer.SetUrl(pszUrl);
m_wmpPlayer.GetControls().play();

....

// Playback stop
m_wmpPlayer.GetControls().stop();
m_wmpPlayer.DestroyWindow(); // will call site's DestroyControl()


Thanks,
Dan


0
1/30/2006 1:07:24 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
738 Views

Similar Articles

[PageSpeed] 16

Reply:

Similar Artilces:

CString and embedded 0s
Meh... I'm in the process of porting code from VS2003 to VS2008 and I found an issue with CString and embedded 0s. In MFC 9 (VS 2008), void Append( const CSimpleStringT& strSrc ), and consequently operator+=()const CSimpleStringT& strSrc), do not work as they used to in MFC 7.1. For example, the following does works with MFC 7.1 and not in MFC 9: CString s(_T("a")); s += CString(_T("b\000c"), 3); ASSERT(s.GetLength() == 4); // ASSERT here I traced it down to CSimpleStringT::Append(PCXSTR pszSrc, int nLength) (atlsimpstr.h, line 400 in MFC9 souurces, ...

Help! I've inherited a messed up plan :
I just came onto a project and got a 1700 line project plan from the previous 4 project managers. Q. Is it normal for tasks with unassigned ? empty resources to show that task in the Resource Usage window? And then on the Gantt View, when I add a resource under that column, it then shows up on the Task line as a Task! I've never seen this happen before. Any ideas?????? J > > Q. Is it normal for tasks with unassigned ? empty resources to show > that task in the Resource Usage window? > Sure - it shows up under the "Unassigned" label. &...

Help with my upgrade path.
We have to accomplish two things. 1. Moving the CRM server to a new machine 2. Upgrading our system to 1.2 What is the best order for this? Jake, I'm not sure it really matters which one you do first, as long as you test each step before moving on to the next. I would probably recommend installing the other server first though. That way, you will have the v1.0 server available if you run into problems with the upgrade. (Granted, it won't funciton if the DB was already upgraded, but will be there for reference). Matt "Jake Horn" <jhorn@order4chaos.com> wrote ...

plz help in to creat formula of excel
hello to all i want to discuss my problem with you related to MS excel. i want to know or find out formula of excel which can help me in such way.... i want to make grade point of my college students in such a way.. for example.... marks grade point average 50 1 53 1.3 60 2 68 2.8 70 3 76 3.6 80 4 84 4 89 4 90 4 98 4 100 4 this is example the student who get 50 marks the GPA will be 1 and who get 80 marks or above 80 the GPA should be 4 GPA should not less than 1 or grator than 4 please tell me the formula so that i can make this GPA thanks a lo -- khushe --------------------------...

Problem with Exchange HTTP virtual server..pls help
Hi, I created Exchange Virtual Server using ESM & the same is not getting reflected under IIS.. What could be the problem here? pls guide... At present, i have 2 Exchange Virtual Servers (http servers) under Protocols > HTTP section of ESM. However, when i open IIS i only see Default Website? Also, i am unable to start/stop newly created Virtual Server using ESM as these options are grayed out. Any help appreciated. I would re-write my query in more detail as follows : Hi, I have my scenario as follows : 1 Front end server 1 Back end server Front end server has 2 ip ad...

Non AD emails going to 1 user
I have an Exchange 2003 server running on SBS 2003 the issues is one user is getting all the emails sent to him that look like they are coming from his domain. For example his email is user@mydomain.com but in his inbox he is getting XYZ@mydomain.com but XYZ is not in the AD or has a email box set up on this server. Why is getting this non AD email and how can I stop it. Thanks in advance Are you sure it's not a SPAM where the spammer may have simply put in 123abc@mydomain.com and BCC it to all possible conceivable names @mydomain.com?? R Green "LaOVis" <LaOVis@discuss...

Copying of non-consecutive, columnar data into consecutive-columnar cells
Hi: I have data located at a1:a9, then a:10 is blank; then, I have 9 more lines of data from a11:a19, and a20 is blank... a1, a11, a21...are all the texts/numbers that I want printed on a different page. But here's the catch: I'd like to print it at locations a1, a2, a3... Specifically, the data that I have appears like this on THIS IS ON SHEET 1: A1: prefix: Mr A2: emailAddress: john.smith@1.com A3: firstName: John A4: lastName: Smith A5: company: ABC Company A6: A7: prefix: Mrs A8: emailAddress: kim.davids@2.com A9: firstName: Kim A10: lastName: Davids A11: company: X...

Creating Dialog Pointer with new, causes Exception
Hello all, I've written an MFC app, which has a tabbed interface. When it starts up, it checks my registry key, to determine how many tabs it needs, it then creates each tab, and puts a custom non modal, child dialog on each tab. The problem is, in release mode, it can only create the first dialog, the second one causes a memory exception. It *looks* like MFC doesnt like me trying to initialize a pointer like so, when that pointer is NULL. m_pDialogs[i] = new CMyDialog; Thing is, isn't that the whole point of the new operator? And malloc for that matter? The only difference, th...

Are there MFC subclasses that give a different "look and feel" to the UI?
I was wondering if there are free implementations of MFC subclasses of windows and controls that give you a different look and feel? I like the Windows 2000 look, but it's quite a bit dated now, and the XP look is hideous for my taste, so I'm looking for something new, more modern looking, sleek. Thanks in advance for any suggestions. Franco See if this has something your looking for. http://www.prof-uis.com/ "Franco" <cuminato@yahoo.com> wrote in message news:1149800640.987272.304540@c74g2000cwc.googlegroups.com... >I was wondering if there are free implementa...

HELP! Seeking Instructions to Create Report of POS (NOT RMS) Discounts Applied
I really need a solution to this problem... We really need to run ongoing reports to determine how many of our different Discounts are claimed/used and the proceeds not tendered. We have offered a number of discounts to customers and employees as incentives and cannot find a method to track how each discount is applied. The built-in reports within POS (not RMS) are not nearly as robust as we wish/require. Is there a query we can run on a transaction table to reveal the discounts applied to those transactions? In the POS Query Tool, running the query "select * from [Transaction]"...

formula help #13
I volunteered to help set up a spreadsheet for a school fundraiser. I need help with a formula. The teacher wants to keep track of student profits. Basically, if a student sells 1-10 items, they receive $20 of credit, if they sell 11-20 items, they receive $20 in the account, etc, How would I set up a formula like that?? HELP Vivian K set up a table with the quantity to sell in one column and the corresponding credit in the next column. Then you can use a Vlookup formula using the actual amount sold as the lookup value to return the credit. See the help on Vlookup to see what you n...

Doc/View architecture (SDI) first view
Hi, I would like for some reasons be able to create the first initial view of my SDI application and I don't know how to do it. For now here is the standard code : = CSingleDocTemplate* pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMainDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame wnd pViewClass ); if (!pDocTemplate) { return FALSE; } AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line....

HELP! Need Access DB to show realtime changes in different location
Hi Guys, I was wondering about how access refreshes it's data within forms and it seems that it doesn't. If i have a form open in one location on a network and update fields on the form the changes are not shown on the form opened in another location. (I.e. if 2 users are in the same form at the same time and one adds a new record the other users form will not show this change). Is there anyway that Access can be setup to show real-time changes over multiple locations? Preferably without having to do a manual refresh by clicking a button or something. All i want to do is show change...

Add Actual End Date to Resolved Cases view
Hi We would like to add the actual end date to the Case General Tab or possibly to the Resolved Cases and/or My Resolved Cases view. I know that the Actual End Date is available on the Service Activity and Case Resolution but this field is not available for the Case. Any workaround for this? Thanks Mark ...

Mixing ATL/MFC in VS2005 (reposting as crosspost)
Does anyone know of some sample code created using VS2005 that implements an out-of-proc COM server mixing MFC and ATL. I tried creating one from scratch but the wizard no longer allows MFC support in an ATL .EXE. Thanks, Drew On Jun 11, 5:52 pm, "Drew" <d...@dam.dam> wrote: > Does anyone know of some sample code created using VS2005 > that implements an out-of-proc COM server mixing MFC and ATL. > I tried creating one from scratch but the wizard no longer allows > MFC support in an ATL .EXE. > > Thanks, > Drew Following link is for VC6. I dont know...

Need help on a formula 05-20-10
I need a formula to calculate the following information please: I will have someone enter a time (ex 6:31) in cell C3. If the time matches one of the times in cells B17-B22 I need it to display 4.6, if it matched one of the times in cells B23-28 I need it to display 4.7, if it matches one of the times in cells B29-34 I need it to display 4.8 and so on. Does anyone have a simple formula I can do for this please? =IF(COUNTIF(B17:B22,C3)>0,4.6,IF(COUNTIF(B23:B28,C3)>0,4.7,IF(COUNTIF(B29:B34,C3)>0,4.8,"no match"))) Can't do the "and so on" part, bu...

Telnet in MFC
Does anyone know of a good example of a telnet (or other text based protocol) client written in MFC? "Isaac Raway" <isaac@blueapples.org> wrote: >Does anyone know of a good example of a telnet (or other text based >protocol) client written in MFC? http://www.mctainsh.com/win32/telnet.aspx -- Tim Slattery MS MVP(DTS) Slattery_T@bls.gov On Fri, 11 Jul 2003 13:25:36 -0500, "Isaac Raway" <isaac@blueapples.org> wrote: >Does anyone know of a good example of a telnet (or other text based >protocol) client written in MFC? > For telnet and termin...

Please Help!!
I am having problems restoring a backup money file from my cdrw disc. I recieve the error that it can't open possibly because it is a read only file or you do not have permission to change it or your disk drive is write protected. I have never had this problem before. I have restored files from my cd backup 3 times before without a problem. Please help!!!! Restore the file to writable media - your hard drive. If you still can't open it, right-click on the file in its new location, choose Properties from the context menu, and remove the check from the 'read-only' box. -...

!!HELP!!! Cannot connect to Exchange Server from a RDP, ICA session or server local machine
Please excuse the posting as I wasn't sure which group to post this in. I'm having issues using Outlook from a server desktop, an RDP or ICA connection. I have remote users who connect using Citrix. They logon to the Citrix server desktop (Windows 2003 Server) and use Outlook from there. They can also use Outlook from within Citrix as it is a Published Application. I know some of you are going to suggest why don't they use OWA but let's not get into that. I can log onto any workstation here in the office and connect to the Exchange server and open their Outlook. What I and they...

Help with a code
I have these code and it works find: but i also want to use it for different culumn within the same sheet. how do i add Column D with different target? meaning "S" for Study and "B" for books and s on... and maybe adding a Msg box to it that will only allow the Letters specify.. thank you in advance.. Private Sub Worksheet_Change(ByVal Target As Range) If Target = "" Then Exit Sub If Target.Count > 1 Then Exit Sub If Not Intersect(Target, Range("c6:c50")) Is Nothing Then If UCase(Target) = "C" Then Target = "Contribution" El...

RMS 2.0 matrix dimensions are annoying, but help is available
For reasons I don't understand, MS saw fit in RMS 2.0 to use dimensions data for matrix components that is far less accessible to users than Sub Descriptions are. For instance, I can't edit assign a dimension value to an existing item I have added to a matrix. I can't see a reason for using Dimensions with limitations like this as using Sub Descs. to describe matrix "dimensions" worked fine previously. Does anyone know why MS did this? It's annoying! Digital Retail Solutions (DRS) has a product called Power Ops (Build 2.2.0003). It's help file mentions (se...

Help-- Having trouble opening Word & Entourage
I have to keep restarting my computer to be able to open Word or Entourage. The icons just bounce a little but won't open. I was getting a request from Entourage to rebuild the database which I did about 6 or 7 times. I got another warning which I ignored. I am on a MacBook Pro (Intel based). I am using office 2004. My Entourage database is 3.2 gb. I ran Disk Utilities a couple of times. I also had a problem a couple of times with FileMaker Pro but not sure if related. Thanks Christina On 22/8/06 20:01, in article 1156273266.788654.318170@i42g2000cwa.googlegroups.com, "...

Terminal Servers in Cluster - Login/Profile Issues
Hello Gurus, Currently I am having an issue with logins and profiles as per details below. Server/Network Configuration Details: 1 X Windows Server 2008 Std FE 64bit (DC) 2 X Windows Server 2008 Ent 32bit Terminal Servers User Profiles are Roaming and exist in: \\SBSERVER\Profiles on the Domain Controller and C:\Users\ on the Terminal Servers. Approx 50 users. Problem Description Error messages when logging in the terminal servers: Your roaming profile is not synchronized correctly with the server. Windows will load your previously-saved local profile instead. See the pre...

Help installing Report Manager
Hi, thanks for any help. Would any one please help clarify. I have read the instructions for installing the report manager on CRM 1.2 and I am wondering if they have left something out. They say to install the ReportManager into a virual directory... Which one? The one inwhich CRM resides? Or are you supposed to create a website 1st and create a new folder for ReportManager to live in? Does the ReportManager site need a host header? Does it need a DNS entry? -or- Are you supposed to go into IIS and create a virtual inside of the CRM website directory? The error I get when i try to ...

WPF non visual dcependancy property inheritance for non-visual objects
Sorry if this is the wrong place to post ths question - feel free to point me to the proper group if it isn't. I am trying to implement WPF dependancy property inheritance in a non-visual object hierarchy. Below is the complete code for a simple console app test - it just requires references to PresentationCore, PresentationFramework & WindowsBase to compile. I am stuck on how to implement the object relations. How does WPF programatically implement containership to enable property inheritance ? It would be a shame if this is only possible with visual elements. Gerr...