source: trunk/DirectShowSpy/Helper.cpp @ 242

Last change on this file since 242 was 242, checked in by roman, 8 years ago
File size: 1.3 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2014
3// Created by Roman Ryltsov roman@alax.info
4
5#include "stdafx.h"
6#include "resource.h"
7#include "FilterGraphHelper.h"
8
9////////////////////////////////////////////////////////////
10// Test
11
12#if _DEVELOPMENT
13
14COMPILER_MESSAGE("Development: CFilterGraphHelper::DoPropertyFrameModal as Test")
15
16#if defined(_WIN64)
17        extern "C" __declspec(dllexport) 
18#else
19        #pragma comment(linker, "/EXPORT:Test=_Test@0,PRIVATE")
20        extern "C" // __declspec(dllexport)
21#endif // defined(_WIN64)
22
23HRESULT STDMETHODCALLTYPE Test() throw()
24{
25        _ATLTRY
26        {
27                CSingleThreadedApartment SingleThreadedApartment;
28                CGenericFilterGraph FilterGraph;
29                FilterGraph.CoCreateInstance();
30                __C(FilterGraph.m_pFilterGraph->RenderFile(_T("E:\\Media\\Robotica_1080.wmv"), NULL));
31                _ATLTRY
32                {
33                        const CComQIPtr<ISpy> pSpy = FilterGraph.m_pFilterGraph;
34                        if(pSpy)
35                                __C(pSpy->put_FriendlyName(CComBSTR(_T("Test"))));
36                }
37                _ATLCATCHALL()
38                {
39                        _Z_EXCEPTION();
40                }
41                CLocalObjectPtr<CFilterGraphHelper> pHelper;
42                pHelper->SetFilterGraph(FilterGraph.m_pFilterGraph);
43                pHelper->DoPropertyFrameModal(0);
44        }
45        _ATLCATCH(Exception)
46        {
47                _C(Exception);
48        }
49        return S_OK;
50}
51
52#endif // _DEVELOPMENT
Note: See TracBrowser for help on using the repository browser.