home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Calling g_Player.Play from timer elapsed event not working
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mars Warrior" data-source="post: 2662" data-attributes="member: 10351"><p>Aha. If hitting play from the control does work, than it might indeed be some kind of context problem.</p><p></p><p>You might check out the Control.BeginInvoke Method (Delegate, Object[]) and EndInvoke methods which:</p><p></p><p><em>The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread, even the thread that owns the control's handle. If the control's handle does not exist yet, this method searches up the control's parent chain until it finds a control or form that does have a window handle. If no appropriate handle can be found, BeginInvoke will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.</em></p><p><em></em></p><p><em><u>Note</u> The BeginInvoke method calls the specified delegate back on a different thread pool thread. You should not block a thread pool thread for any length of time.</em></p><p><em><u>Note</u> There are four methods on a control that are safe to call from any thread: Invoke, BeginInvoke, EndInvoke, and CreateGraphics. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.</em></p><p></p><p>Altough I can't say for sure that it is INDEED a context problem, but if it is the BeginInvoke should solve it <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="Mars Warrior, post: 2662, member: 10351"] Aha. If hitting play from the control does work, than it might indeed be some kind of context problem. You might check out the Control.BeginInvoke Method (Delegate, Object[]) and EndInvoke methods which: [i]The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread, even the thread that owns the control's handle. If the control's handle does not exist yet, this method searches up the control's parent chain until it finds a control or form that does have a window handle. If no appropriate handle can be found, BeginInvoke will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler. [u]Note[/u] The BeginInvoke method calls the specified delegate back on a different thread pool thread. You should not block a thread pool thread for any length of time. [u]Note[/u] There are four methods on a control that are safe to call from any thread: Invoke, BeginInvoke, EndInvoke, and CreateGraphics. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.[/i] Altough I can't say for sure that it is INDEED a context problem, but if it is the BeginInvoke should solve it ;) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Calling g_Player.Play from timer elapsed event not working
Contact us
RSS
Top
Bottom