PDA

View Full Version : problem with IMVGDIOverlay interface



aslihannur
December 30, 2005, 16:56:56
Hi all,

I am trying to access IMVGDIOverlay interface in my playout application that developed with DirectShow in C++. I need to reach DC surface with GetDC method.

Relevant part of the code like that :


IBaseFilter *pTemp;
CComPtr<IMVGDIOverlay> pGDI;
HDC hDC;
CDC* pDC;


CController::_dEngine->get_gBuilder()->FindFilterByName(L"MV GDI Overlay", &pTemp); //it is just the filter structure of my app, pTemp is IBaseFilter

pTemp->QueryInterface(IID_IMVGDIOverlay, (void**) &pGDI);

if(pGDI->GetDC((long*)&hDC) == S_OK)
{
pDC = CDC::FromHandle(hDC);
if(pDC != 0L)
{

RECT rctB = {100,100,180,230};
pDC->DrawText("some text",&rctB,0);

pGDI->ReleaseDC((long*)&hDC);
}
}

pTemp->Release();


The code is compiled ok, but it says
"unresolved external symbol _IID_IMVGDIOverlay"
while linking.

iMVGDIOverlay.h is included. I also include mv.h and tried. But it did not work.
What I find strange is; it doesn't give an error for "IMVGDIOverlay" , just could not resolve REFIID.

What is wrong with my code? How can I solve this?

Any help will be appreciated.

Thanks in advance

Nihal

Bernd Peretzke
January 2, 2006, 12:25:46
Hi Nihal,

You have to include the initguid.h before mv.h. The initguid.h header creates a instance from the guid's. But include the initiguid.h only once in your project.

#include <initguid.h>
#include <mv.h>

Regards
Bernd

aslihannur
January 3, 2006, 11:04:20
Thanks for the info.

Nihal