From: David Leahy on
Hi,

When I run media player as part of my Compact Framework application (2.0) it
runs fine, but when I try to exit the application it hangs and freezes the
application - requiring a reboot - I've read somewhere that some Marshal com
object can solve this, but I've no idea how - have you any other suggestions
? I've coding in VB.net

Thanks

David
From: " ctacke/>" on
How are you "running media player"? Though a Process class that just
executes it?


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com


"David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
news:51F3ADBF-88AF-4B48-86F8-B20FA062287D(a)microsoft.com...
> Hi,
>
> When I run media player as part of my Compact Framework application (2.0)
> it
> runs fine, but when I try to exit the application it hangs and freezes the
> application - requiring a reboot - I've read somewhere that some Marshal
> com
> object can solve this, but I've no idea how - have you any other
> suggestions
> ? I've coding in VB.net
>
> Thanks
>
> David


From: David Leahy on
Here is my code:

Public player As New WMPLib.WindowsMediaPlayer()


Dim mypath As String
mypath = GetAppPath()


try

If File.Exists(mypath) = True Then
player.URL = mypath
'System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\media\change.mp3"
MsgBox(player.URL)
player.settings.volume = 100
player.controls.play()
End If


Catch err As SqlCeException
'Insert error handling code here
MessageBox.Show(err.Message)

End Try

Public Function GetAppPath() As String
Return System.IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
End Function



The application hangs unless I comment all of the above code out

Regards

David




"<ctacke/>" wrote:

> How are you "running media player"? Though a Process class that just
> executes it?
>
>
> --
>
> Chris Tacke, eMVP
> Join the Embedded Developer Community
> http://community.opennetcf.com
>
>
> "David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
> news:51F3ADBF-88AF-4B48-86F8-B20FA062287D(a)microsoft.com...
> > Hi,
> >
> > When I run media player as part of my Compact Framework application (2.0)
> > it
> > runs fine, but when I try to exit the application it hangs and freezes the
> > application - requiring a reboot - I've read somewhere that some Marshal
> > com
> > object can solve this, but I've no idea how - have you any other
> > suggestions
> > ? I've coding in VB.net
> >
> > Thanks
> >
> > David
>
>
>
From: " ctacke/>" on
I assume the WMPLib is one generated following the COM interop webcast on
MSDN? There isn't one directly in the CF. My guess is that on close you
need to be cleaning up your COM references.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com




"David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
news:FEE9A3A5-F65A-4CE2-BDAA-E142F39CDB29(a)microsoft.com...
> Here is my code:
>
> Public player As New WMPLib.WindowsMediaPlayer()
>
>
> Dim mypath As String
> mypath = GetAppPath()
>
>
> try
>
> If File.Exists(mypath) = True Then
> player.URL = mypath
> 'System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
> + "\media\change.mp3"
> MsgBox(player.URL)
> player.settings.volume = 100
> player.controls.play()
> End If
>
>
> Catch err As SqlCeException
> 'Insert error handling code here
> MessageBox.Show(err.Message)
>
> End Try
>
> Public Function GetAppPath() As String
> Return System.IO.Path.GetDirectoryName( _
>
> System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
> End Function
>
>
>
> The application hangs unless I comment all of the above code out
>
> Regards
>
> David
>
>
>
>
> "<ctacke/>" wrote:
>
>> How are you "running media player"? Though a Process class that just
>> executes it?
>>
>>
>> --
>>
>> Chris Tacke, eMVP
>> Join the Embedded Developer Community
>> http://community.opennetcf.com
>>
>>
>> "David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
>> news:51F3ADBF-88AF-4B48-86F8-B20FA062287D(a)microsoft.com...
>> > Hi,
>> >
>> > When I run media player as part of my Compact Framework application
>> > (2.0)
>> > it
>> > runs fine, but when I try to exit the application it hangs and freezes
>> > the
>> > application - requiring a reboot - I've read somewhere that some
>> > Marshal
>> > com
>> > object can solve this, but I've no idea how - have you any other
>> > suggestions
>> > ? I've coding in VB.net
>> >
>> > Thanks
>> >
>> > David
>>
>>
>>


From: David Leahy on

Other people are having the same problem - check:

http://objectmix.com/dotnet/98243-using-windowmediaplayer-object-smartphone-freezes-application.html

They mention some Marshall release object but still can't seem to fix the
problem ? Is there any other way to use media player in Compact Framework
which is not affected by this problem ?

Thanks

David


"<ctacke/>" wrote:

> I assume the WMPLib is one generated following the COM interop webcast on
> MSDN? There isn't one directly in the CF. My guess is that on close you
> need to be cleaning up your COM references.
>
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Giving back to the embedded community
> http://community.OpenNETCF.com
>
>
>
>
> "David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
> news:FEE9A3A5-F65A-4CE2-BDAA-E142F39CDB29(a)microsoft.com...
> > Here is my code:
> >
> > Public player As New WMPLib.WindowsMediaPlayer()
> >
> >
> > Dim mypath As String
> > mypath = GetAppPath()
> >
> >
> > try
> >
> > If File.Exists(mypath) = True Then
> > player.URL = mypath
> > 'System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
> > + "\media\change.mp3"
> > MsgBox(player.URL)
> > player.settings.volume = 100
> > player.controls.play()
> > End If
> >
> >
> > Catch err As SqlCeException
> > 'Insert error handling code here
> > MessageBox.Show(err.Message)
> >
> > End Try
> >
> > Public Function GetAppPath() As String
> > Return System.IO.Path.GetDirectoryName( _
> >
> > System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
> > End Function
> >
> >
> >
> > The application hangs unless I comment all of the above code out
> >
> > Regards
> >
> > David
> >
> >
> >
> >
> > "<ctacke/>" wrote:
> >
> >> How are you "running media player"? Though a Process class that just
> >> executes it?
> >>
> >>
> >> --
> >>
> >> Chris Tacke, eMVP
> >> Join the Embedded Developer Community
> >> http://community.opennetcf.com
> >>
> >>
> >> "David Leahy" <DavidLeahy(a)discussions.microsoft.com> wrote in message
> >> news:51F3ADBF-88AF-4B48-86F8-B20FA062287D(a)microsoft.com...
> >> > Hi,
> >> >
> >> > When I run media player as part of my Compact Framework application
> >> > (2.0)
> >> > it
> >> > runs fine, but when I try to exit the application it hangs and freezes
> >> > the
> >> > application - requiring a reboot - I've read somewhere that some
> >> > Marshal
> >> > com
> >> > object can solve this, but I've no idea how - have you any other
> >> > suggestions
> >> > ? I've coding in VB.net
> >> >
> >> > Thanks
> >> >
> >> > David
> >>
> >>
> >>
>
>
>
 |  Next  |  Last
Pages: 1 2
Prev: SIP Notifications
Next: RIL C#