2

我正在使用 Visual Studio 2008 为我的 Windows Mobile 6.1 设备开发 SmartDevice Win32 DLL。我必须使用 DirectShow 并开始复制基本示例。

.h: _

#pragma once

// Additional Include Directories:
// "C:\Program Files (x86)\Windows Mobile 6 SDK\Smartphone\Include\Armv4i"
#include <dshow.h>

// Included strmiids.lib for CLSID_FilterGraph and IID_IGraphBuilder (.cpp)
#pragma comment(lib, "strmiids.lib")



extern "C" {

    __declspec(dllexport) bool InitCOM();

}

.cpp

#include "stdafx.h"
#include "DLLDevice.h"


BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
                     )
{
    return TRUE;
}



__declspec(dllexport) bool InitCOM()
{
    if(FAILED(CoInitialize(NULL)))
        return false;

    IGraphBuilder* pGraphBuilder = NULL;
    HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, 
        IID_IGraphBuilder, (void**) &pGraphBuilder);

    if(FAILED(hr))
        return false;

    IMediaControl *pMediaControl = NULL;
    hr = pGraphBuilder->QueryInterface(IID_MediaControl, (void**) &pMediaControl);


    pGraphBuilder->Release();

    return true;
}

现在我有一个链接器错误:

error C2065: 'IID_MediaControl' : undeclared identifier

为什么?我怎么解决这个问题?
为什么无法使用 DirectShow 创建项目?

4

1 回答 1

2

因为是IID_IMediaControl,不是IID_MediaControl

于 2012-10-14T16:53:29.950 回答