Nick
Nick

Reputation: 10499

IID_MediaControl undeclared identifier

I'm developping a SmartDevice Win32 DLL for my device with Windows Mobile 6.1 using Visual Studio 2008. I have to use DirectShow and I started reproducing the basic example.

The .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();

}

And the .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;
}

Now I have a linker error:

error C2065: 'IID_MediaControl' : undeclared identifier

Why? How can I solve this problem?
Why is thus impossible to create a project with DirectShow?

Upvotes: 2

Views: 947

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69642

Because it is IID_IMediaControl, not IID_MediaControl.

Upvotes: 2

Related Questions