Handle auf Window^^



  • Hi@all. Habe da mein Problem mit Handle mal zusammen gefasst. Habe eine normale Dialog-Anwendung erstellt und nen Button dazu mit folgendem Quelltext:

    void CtestDlg::OnBnClickedButton1()
    {
    	CoInitialize(NULL);
    	IGraphBuilder *pGraph;
    	CoCreateInstance(CLSID_FilterGraph, NULL, 
        CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
    	IMediaControl *pControl;
    	IMediaEvent   *pEvent;
    	IVideoWindow *pVidWin = NULL;
    	pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
    	pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
    	pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
    
    	const char* WndClass=AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW);	//Fensterklasse für MovieWindow registrieren.
    	CWnd *p=new CWnd;
    	p->CreateEx(NULL,WndClass,"CAMEDI",WS_POPUP|WS_TABSTOP|WS_CAPTION|WS_SYSMENU|WS_VISIBLE|WS_MINIMIZEBOX,250,50,700,450,NULL,NULL);	//MovieWindow erstellen (anzeigen).
    
    	pVidWin->put_Owner((OAHWND)p->m_hWnd);
    	pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
    	RECT grc;
    	::GetClientRect(p->m_hWnd, &grc);
    	pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom);
    	pGraph->RenderFile(L"C:\\test.avi", NULL);
    	pControl->Run();
    	long evCode = 0;
    	pEvent->WaitForCompletion(INFINITE, &evCode);
    	pControl->Release();
    	pEvent->Release();
    	pGraph->Release();
    	CoUninitialize();
    }
    

    Mein Problem ist, das m_hWnd der Handle auf den Dialog ist. Das Video wird aber nicht wirklich im Dialog angezeigt. Was mache ich falsch??

    danke!!!
    grüße



  • sorry hab mich vertan. habe hier ja schon das neue fenster erstellt. ändert aber nichts. im dialog und im neuen fenster wird nichts angezeigt 😞


Anmelden zum Antworten