Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: FindFirstFile problem Pin
Rickard Andersson2015-Dec-02 7:59
Rickard Andersson2015-Dec-02 7:59 
GeneralRe: FindFirstFile problem Pin
Chris Losinger15-Dec-02 8:19
professionalChris Losinger15-Dec-02 8:19 
GeneralRe: FindFirstFile problem Pin
Jörgen Sigvardsson15-Dec-02 7:51
Jörgen Sigvardsson15-Dec-02 7:51 
GeneralOperatingSystemSimulator Pin
sikrip15-Dec-02 7:30
sikrip15-Dec-02 7:30 
GeneralRe: OperatingSystemSimulator Pin
zenboy15-Dec-02 13:57
zenboy15-Dec-02 13:57 
General_tsplitpath(..) API Pin
sedonya15-Dec-02 7:05
sedonya15-Dec-02 7:05 
GeneralRe: _tsplitpath(..) API Pin
Michael Dunn15-Dec-02 12:02
sitebuilderMichael Dunn15-Dec-02 12:02 
GeneralDirectShow: playing wmv Pin
hdi99kf@syd.kth.se15-Dec-02 6:28
hdi99kf@syd.kth.se15-Dec-02 6:28 
Hello.

I have an application which plays wmv-files. This is the code that runs when the play button is clicked:

IGraphBuilder* m_pGraph;<br />
IVideoWindow* m_pVidWin;<br />
IMediaEventEx* m_pEvent;<br />
IMediaControl* m_pMediaControl;<br />
<br />
USES_CONVERSION; <br />
CoCreateInstance(CLSID_FilterGraph, NULL,<br />
    CLSCTX_INPROC,IID_IGraphBuilder, (void **)&m_pGraph);<br />
m_pGraph->RenderFile(A2W(m_strVideoFile),NULL);<br />
m_pGraph->QueryInterface(IID_IVideoWindow, (void **)&m_pVidWin); <br />
<br />
m_pVidWin->put_Owner((OAHWND)this->GetSafeHwnd()); <br />
m_pVidWin->put_WindowStyle(WS_CHILD); <br />
<br />
m_pGraph->QueryInterface(IID_IMediaEventEx, (void **)&m_pEvent); <br />
m_pEvent->SetNotifyWindow((OAHWND)this->GetSafeHwnd(),WM_GRAPHNOTIFY, 0); <br />
<br />
m_pGraph->QueryInterface(IID_IMediaControl, (void **)&m_pMediaControl); <br />
m_pVidWin->SetWindowPosition(XMARG,YMARG,iWidth,iHeight);<br />
m_pVidWin->put_Visible (OATRUE); <br />
m_pMediaControl->Run();


There is one problem with this code. The first time the button is clicked the movie is not played but tha second and third time it works fine. Does anybody have any idea on what is wrong? Any help would be very appriciated.

/Charlie.
GeneralGDI question Pin
Shah Shehpori15-Dec-02 6:15
sussShah Shehpori15-Dec-02 6:15 
GeneralRe: GDI question Pin
Paul M Watt15-Dec-02 17:50
mentorPaul M Watt15-Dec-02 17:50 
GeneralPoliticalamity Pin
Kevnar15-Dec-02 5:52
Kevnar15-Dec-02 5:52 
GeneralRe: Politicalamity Pin
Michael Dunn15-Dec-02 6:28
sitebuilderMichael Dunn15-Dec-02 6:28 
GeneralRe: Politicalamity Pin
Kevnar15-Dec-02 6:50
Kevnar15-Dec-02 6:50 
GeneralRe: Politicalamity Pin
Christian Graus15-Dec-02 10:57
protectorChristian Graus15-Dec-02 10:57 
GeneralRe: Politicalamity Pin
ColinDavies15-Dec-02 14:26
ColinDavies15-Dec-02 14:26 
GeneralRe: Politicalamity Pin
Kevnar15-Dec-02 15:57
Kevnar15-Dec-02 15:57 
GeneralRe: Politicalamity Pin
Christian Graus15-Dec-02 10:54
protectorChristian Graus15-Dec-02 10:54 
GeneralRe: Politicalamity Pin
Kevnar15-Dec-02 15:48
Kevnar15-Dec-02 15:48 
GeneralRe: Politicalamity Pin
Christian Graus15-Dec-02 15:54
protectorChristian Graus15-Dec-02 15:54 
QuestionHwo to handle "tab" to visually deisgnate have focus? Pin
Stan the man15-Dec-02 5:49
Stan the man15-Dec-02 5:49 
AnswerRe: Hwo to handle "tab" to visually deisgnate have focus? Pin
Michael Dunn15-Dec-02 6:29
sitebuilderMichael Dunn15-Dec-02 6:29 
QuestionRetrieve the file names from a dir? Pin
Rickard Andersson2015-Dec-02 3:47
Rickard Andersson2015-Dec-02 3:47 
AnswerRe: Retrieve the file names from a dir? Pin
Chris Losinger15-Dec-02 3:54
professionalChris Losinger15-Dec-02 3:54 
GeneralRe: Retrieve the file names from a dir? Pin
Rickard Andersson2015-Dec-02 4:16
Rickard Andersson2015-Dec-02 4:16 
GeneralRe: Retrieve the file names from a dir? Pin
Jörgen Sigvardsson15-Dec-02 4:27
Jörgen Sigvardsson15-Dec-02 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.