derek
May 26, 2004, 00:44:39
I'm a little unsure when to use MVSmartControlClass verses AxMVSmartControl?
I was writing a transcode application that will not Render video to the screen. As such, I created a MVSmartControlClass to do the work. I want to get an EndOfStream event to know when the processing is finished. I use the following code:
MVSmartControl.MVSmartControl sc = new MVSmartControl.MVSmartControlClass();
...
sc.EndOfStream +=new _IMVSmartControlEvents_EndOfStreamEventHandler(sc_ EndOfStream);
However, sc_EndOfStreams is never called when the stream ends.
The following works (ocxSC_EndOfStream is called):
AxMVSmartControl.AxMVSmartControl ocxSC = new AxMVSmartControl.AxMVSmartControl();
...
ocxSC.EndOfStream +=new EventHandler(ocxSC_EndOfStream);
And the following also works:
AxMVSmartControl.AxMVSmartControl ocxSC = new AxMVSmartControl.AxMVSmartControl();
...
MVSmartControl.MVSmartControl sc = (MVSmartControl.MVSmartControl)ocxSC.GetOCX();
sc.EndOfStream +=new _IMVSmartControlEvents_EndOfStreamEventHandler(sc_ EndOfStream);
So it looks like events will not be generated using only the MVSmartControlClass? I know I can make the OCX not visible but it just seemed like using the MVSmartControlClass directly was the proper thing to do. What else is its purpose?
Thanks in advance for help.
I was writing a transcode application that will not Render video to the screen. As such, I created a MVSmartControlClass to do the work. I want to get an EndOfStream event to know when the processing is finished. I use the following code:
MVSmartControl.MVSmartControl sc = new MVSmartControl.MVSmartControlClass();
...
sc.EndOfStream +=new _IMVSmartControlEvents_EndOfStreamEventHandler(sc_ EndOfStream);
However, sc_EndOfStreams is never called when the stream ends.
The following works (ocxSC_EndOfStream is called):
AxMVSmartControl.AxMVSmartControl ocxSC = new AxMVSmartControl.AxMVSmartControl();
...
ocxSC.EndOfStream +=new EventHandler(ocxSC_EndOfStream);
And the following also works:
AxMVSmartControl.AxMVSmartControl ocxSC = new AxMVSmartControl.AxMVSmartControl();
...
MVSmartControl.MVSmartControl sc = (MVSmartControl.MVSmartControl)ocxSC.GetOCX();
sc.EndOfStream +=new _IMVSmartControlEvents_EndOfStreamEventHandler(sc_ EndOfStream);
So it looks like events will not be generated using only the MVSmartControlClass? I know I can make the OCX not visible but it just seemed like using the MVSmartControlClass directly was the proper thing to do. What else is its purpose?
Thanks in advance for help.