Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: WindowsMediaPlayerClass without Forms, is that even possible?

HTVi
TV Discussion Newsgroups

WindowsMediaPlayerClass without Forms, is that even possible?
Eric 5/13/2007 2:38:01 AM
Goal: Be able to test a windows media stream via the command line, and print
the output "OK" or "ERR" depending on the status. I was able to successfully
do it via windows forms: "app.exe http://url/file.wmv"

Problem: However, these will only work if executed from a
logged-in-desktop's command prompt. When I have the call executed FROM
another NT service, I get an error in the event viewer:

Exception in show dialog System.InvalidOperationException: Showing a modal
dialog box or form when the application is not running in UserInteractive
mode is not a valid operation. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()

Alternative Solution #1 (didn't work): I removed the call
'form.showDialog()' to avoid the error; but that caused Windows Media Player
to not play the content at all, and remain in the 'transitioning' state.

Alternative Solution #2 (didn't work): I tried testing both
WindowsMediaPlayerClass and AxWindowsMediaPlayer and see who would work, but
no luck.

Help anyone? Is this possible?
Re: WindowsMediaPlayerClass without Forms, is that even possible?
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 5/13/2007 6:14:24 PM
From: "Eric"

[Quoted Text]
> Goal: Be able to test a windows media stream via the
> command line, and print the output "OK" or "ERR"
> depending on the status. I was able to successfully do
> it via windows forms: "app.exe http://url/file.wmv"
>
> Problem: However, these will only work if executed from a
> logged-in-desktop's command prompt. When I have the call
> executed FROM another NT service, I get an error in the
> event viewer:

The WMP OCX is a GUI component and you really shouldn't use
GUI components in a service. What exactly are you trying to
do with WMP?


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Re: WindowsMediaPlayerClass without Forms, is that even possible?
Eric 5/15/2007 3:37:02 AM
Hi,

I'm trying to monitor windows media streams from an NT service. Is that
possible?

Thanks.

"Alessandro Angeli" wrote:

[Quoted Text]
> From: "Eric"
>
> > Goal: Be able to test a windows media stream via the
> > command line, and print the output "OK" or "ERR"
> > depending on the status. I was able to successfully do
> > it via windows forms: "app.exe http://url/file.wmv"
> >
> > Problem: However, these will only work if executed from a
> > logged-in-desktop's command prompt. When I have the call
> > executed FROM another NT service, I get an error in the
> > event viewer:
>
> The WMP OCX is a GUI component and you really shouldn't use
> GUI components in a service. What exactly are you trying to
> do with WMP?
>
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
Re: WindowsMediaPlayerClass without Forms, is that even possible?
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 5/15/2007 4:06:30 AM
From: "Eric"

[Quoted Text]
> I'm trying to monitor windows media streams from an NT
> service. Is that possible?

That depends on what you mean by "monitor windows media
streams". If you only want to know whether the service can
successfully connect to a publishing point, you can use the
WMReader object in the WindowsMediaFormat runtime through
COM InterOp: just open the stream URL by calling
IWMReader::Open() and look at the HRESULT.


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen