-1

Does anyone have any insight as to what can cause a scenario where if you were to call

mediaControl.Run();

that it won't actually start rendering video until this is called

MessageBox.Show("");

I couldn't figure out why the media wasn't running even when getstate returned that it was running until i return the HRESULT which said sure its running... but only displays video on the window when a messagebox is shown.

The weird thing is that if you dismiss the messagebox, and rendering pauses... but if you called it again say 5 seconds after, it continue to works.

Furthermore... if you dismiss the messagebox and have a continous loop right after it that sleeps the thread indefinitely, it continues to render.

I have been banging my head all day with this trying to figure out why a messagebox is key... but ultimately, I can't have a messagebox display.

Any random ideas would be helpful too... thanks.

Cheers.

bl4kh4k
  • 1,440
  • 4
  • 20
  • 34
  • 3
    It would help to know the code you are using. If its a short, post all of it or try to pick out the needed parts if the project is really big. – Wesley Sep 24 '12 at 19:58

1 Answers1

1

The main thing MessageBox.Show() does is to run the message loop. You may be able to replace it with simulated DoEvents() (see this answer)

But there probably is a serious problem in your code surrounding this.

Community
  • 1
  • 1
H H
  • 263,252
  • 30
  • 330
  • 514
  • Link wasn't helpful... but mentioning the message loop gave me the clue I needed. I am accessing User32.dll to do a PostThreadMessage and when stopping at that break point every so often the video renders... so now I should be on track... no need for a messagebox. Thank you. Not sure who voted me down, it was an honest question but oh well... you pointed me in the direction i need to go. Cheers. – bl4kh4k Sep 24 '12 at 20:24