Hello I have been trying to add media player to my mfc dialog and invoke the same to play URL. I have been unsuccessful.
I have build a WPF media player application in c#.Net 4.0. I would like to take this WPF application and put it on a Windows Embedded operating system. This would take out all the things I don't need and just make a simple power on and my application loads.
OS - Windows 10 VS Studio - VS 2013 professional My objective is to embed the media player in my application and pass a file name to to start playing. Steps done to add media player. Create a mfc application dialog project with activex control enabled.
The project creates the following files video.cpp videoDlg.cpp video.h videoDlg.h 2. Go to resource manager Go to video.rc - Dialog Double click IDDVIDEODIALOG 3. Right click and insert activex control on the dialog window.
Choose the windows media player from the list and press OK. Right click on the media player on the dialog and click class wizard - Choose mfc class from type lib (Only this gives windows media player as an option From the available libraries choose 'windows media player Then choose 'ImediaPlayer2' from the interfaces and add it to generated classes. The above step creates the following CMediaPlayer2 class and CMediaPlayer.h header file. Then I add variable name vidctrl of type COcx1 This creates two files ocx1.h and ocx1.cpp The I add vidctrl.open in my init code. It doesnt find the open function.
So I copy the functions from the CMediaPlayer2.h to ocx1.h Then I try to call vidctrl.open again and it builds. When I run it a message window pops up saying 'member not found' When I step through I find that message window pops when the vidctrl.open is called. I can send the project files as a zip for this. The problem I am facing is how to connect the variable to the interface functions?
Any help would be very much appreciated. Thanks & Regards, Rakesh. I do not see the events listed. Probably I am on a wrong understanding of what the dialog designer is. When you say dialog designer I do the following. Resource View - ProjectName.rc - Dialog - IDDVIDEOPLAYER(xxxxxxx) I double click on it and I am presented with the dialog designer.
It contains the windows media player active X control. I select it but I dont see any properties pane with event listed. What I see is the properties window in the bottom right which has items like 'open state' 'play state' 'url' 'windowless Video'. I have wrongly understood on what you mean by dialog designer. Regards, Rakesh.
I am a little bit perplexed by this: I can insert the control fine, but from there on the instructions don't work for me. The following: 6: Right click to control and select Add Variable 7: Enter mMediaPlayer (or whatever you want) as the control variable without changing any other property 8: This will add a ocx1.h and a ocx1.cpp to the project, and #include 'ocx1.h' is also added to main dialog. A) Right click on the control or the dialog itself? B) What type is mMediaPlayer? C) the ocx1 header and source files do not get added in mine. When I follow the above steps, all that is added to my files is a variable mMediaPlayer of type COCX.
Type COCX is subsequently unrecognised by the compiler. I am a little bit perplexed by this: I can insert the control fine, but from there on the instructions don't work for me. The following: 6: Right click to control and select Add Variable 7: Enter mMediaPlayer (or whatever you want) as the control variable without changing any other property 8: This will add a ocx1.h and a ocx1.cpp to the project, and #include 'ocx1.h' is also added to main dialog. A) Right click on the control or the dialog itself?
B) What type is mMediaPlayer? C) the ocx1 header and source files do not get added in mine.
When I follow the above steps, all that is added to my files is a variable mMediaPlayer of type COCX. Type COCX is subsequently unrecognised by the compiler. When answering a question please:. Read the question carefully.
![Player Player](/uploads/1/2/5/4/125417451/850253571.gif)
Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem.
Insults are not welcome. Don't tell someone to read the manual.
Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.