03-29-2019 05:43 AM
Hi Everyone,
I'm trying to use Windows Media Player in my Labwindows/CVI 2017 project (There is an example attached).
I would like to disable all the default buttons of Windows Media Player and use CVI buttons for PLAY, PAUSE, STOP, FAST FORWARD, FAST REWIND but I'm not able to do this.
When I use WMPLib_IWMPEvents4PlayStateChange the function return an error.
Is there a complete example to use WMP in CVI?
Someone have already done something like that?
Is there an alternative ActiveX to manage video?
Thank's at all
04-01-2019 06:54 AM - edited 04-01-2019 07:10 AM
Hi Mattia,
I tried to launch the example you attached and - after a first error message or warning that I can't remember and that didn't show up again in subsequent attempts - the reproduction of TEST_VIDEO.wmv started, of which you can see one screenshot below.
Could you explain better which result you want to get, and maybe attach a screenshot of the error returned by the function?
Thank you!
Regards,
Alessia
04-01-2019
07:23 AM
- last edited on
06-04-2025
06:39 PM
by
Content Cleaner
Hi,
I can add that the following example seems to do for you, at least as a starting point:
Controlling Windows Media Player from LabWindows/CVI
Regards,
Alessia
04-01-2019 11:20 AM
Hi Alessia,
I've already tried the example but the WMP ActiveX used is older than the actual ActiveX.
With the new WMP ActiveX the function for START, STOP, PAUSE, FF, FR,... not work. The function give me an error.
In attached you find the error.
I hope I explained myself.
Thank's for your help.
Regards,
Mattia
04-02-2019 05:40 AM
Hi Mattia,
the error code you got means "No such interface supported".
I have found another thread that could provide useful insights:
Setting up and using an ActiveX control
Please let me know if this helps you to solve your issue, or if at least we can narrow down its extent.
Regards,
Alessia
04-08-2019 03:52 AM
Hi Alessia,
I tried to read the thread and also other threads related to the topic but unfortunately I was not able to resolve the issue through the use of windows media player.
The only solution found is a ViscomSoft ActiveX (http://www.viscomsoft.com/products/movieplayer) but it is not free.
But I think it is impossible that there is no solution with the Windows Media Player ActiveX native of Windows.
Regards,
Mattia
04-23-2019
08:45 AM
- last edited on
06-04-2025
06:39 PM
by
Content Cleaner
Hi Mattia,
I asked a colleague more skilled than me for help about your issue, and here are his suggestions.
Where did you get the "ActiveX Windows Media Player driver" from? It's CVI code potentially from NI, however we couldn't find its source.
It seems that it is simply outdated, I guess that Microsoft's API to Windows Media Player (WMP) changed since this driver was created, which explains why the code forwarding user actions doesn't work anymore. When/where did you get it from? On which WMP version was it intended to work? And finally which OS are you using?
My colleague also added:
The link to Controlling Windows Media Player from LabWindows/CVI you already gave your customer seems like the solution to me. The project attached on that page implements exactly what your customer is asking for. On my system it successfully uses WMP 12 to play a video while hiding all normal WMP controls, and has custom-made controls on the CVI form (=Front Panel) that control WMP. As far as I understand this is exactly what your customer wants.
Funnily this example is from 2006, so no idea why this WMP code is still working while the driver your customer has (assuming it is newer) fails.
So all your customer needs seems to be to switch from his WMP ActiveX driver to the one in the project attached to Controlling Windows Media Player from LabWindows/CVI.
Finally, maybe WMP SDK is needed to run the application from CVI. Some years ago (up to WMP 9.0) this was a separate download from Microsoft. Since Windows 7 or 8 WMP SDK is integrated in Microsoft SDK. Still, you might need to install it. Most developers have, but you did not state anything.
I look forward to hearing from you.
Regards,
Alessia
04-24-2019 03:11 AM
Hi Alessia,
I'm working on Windows 10 Pro version 1809 with LabWindows/CVI 2017. I select Window Media Payer from the ActiveX Object list (see image in attachment) and the I generate ActiveX Control driver from the menu. Did I do something wrong in this steps?
The link to the example project that you gave me, as your colleague says, seems like the solution but there is a problem. When I modify uir file and try to save it gave me an error, so I can't use it in my other projects.
If I try to use WMP ActiveX driver used in the Controlling Windows Media Player from LabWindows/CVI example with the Window Media Payer ActiveX from the ActiveX Object List but it doesn't work. The functione return this error code -> -2147467262
Regarding Windows SDK I have installed Windows SDK 8.1.
I hope I explained myself and I hope to find a solution.
Thank's for your precious help.
Regards,
Mattia