線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:947
推到 Plurk!
推到 Facebook!

DirectShow 無法執行

尚未結案
simgen
一般會員


發表:2
回覆:3
積分:1
註冊:2004-11-09

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-11-15 00:27:45 IP:61.219.xxx.xxx 未訂閱
請教各為先進 TRect 為什麼在BCB中無法執行呢    //---------------------------------------------------------------------------    #include  #pragma hdrstop #include "Unit1.h" #include #include #define CLASSNAME "VideoWindow" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; IGraphBuilder *pGraph = NULL; IMediaControl *pMediaControl = NULL; IVideoWindow *pVidWin = NULL; HWND g_hwnd; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { // Create the filter graph manager. CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **)&pGraph); pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl); pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin); // Build the graph. pGraph->RenderFile(L"C:\\CAPTURE.AVI", NULL); //Set the video window. g_hwnd=Form1->Handle; pVidWin->put_Owner((OAHWND)g_hwnd); pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS); TRECT grc;<-------------------------------無法執行 grc=Form1->ClientRect;<-------------------無法執行 pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom); // Run the graph. pMediaControl->Run(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { pVidWin->put_Visible(OAFALSE); pVidWin->put_Owner(NULL); pMediaControl->Release(); pVidWin->Release(); pGraph->Release(); } //---------------------------------------------------------------------------
simgen
一般會員


發表:2
回覆:3
積分:1
註冊:2004-11-09

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-11-15 02:12:38 IP:61.219.xxx.xxx 未訂閱
對不起更政部份內容 請各位先進 能給予指教 因為這各程式執行到一半就會停止    //---------------------------------------------------------------------------    #include  #pragma hdrstop #include "Unit1.h" #include "DShow.h" #include "windows.h" #define CLASSNAME "VideoWindow" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; IGraphBuilder *pGraph = NULL; IMediaControl *pMediaControl = NULL; IVideoWindow *pVidWin = NULL; HWND g_hwnd; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { // Create the filter graph manager. CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **)&pGraph); //執行到這裡就不行了 請教各位高手能給小弟一些意見 pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl); pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin); // Build the graph. pGraph->RenderFile(L"C:\\CAPTURE.AVI", NULL); //Set the video window. g_hwnd=Form1->Handle; pVidWin->put_Owner((OAHWND)g_hwnd); pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS); TRect grc; grc=Form1->ClientRect; pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom); // Run the graph. pMediaControl->Run(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { pVidWin->put_Visible(OAFALSE); pVidWin->put_Owner(NULL); pMediaControl->Release(); pVidWin->Release(); pGraph->Release(); } //---------------------------------------------------------------------------
系統時間:2024-05-17 10:56:49
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!