1
我正在爲使用Visual Studio 2008的Windows Mobile 6.1爲我的設備開發SmartDevice Win32 DLL。我必須使用DirectShow,並開始重現基本示例。IID_MediaControl未聲明的標識符
的.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創建項目?
謝謝,我正在閱讀編程的微軟directShow數字視頻和電視,並在COM基礎上他寫了IID_MediaControl,我不知道爲什麼... – Nick
接口是'IMediaControl','IID_'是典型的關聯前綴IID。對於大多數接口,您也可以使用'__uuidof(IMediaControl)'。 –