0

I use a sample from windows to learn DirectShow, and in a class I have this code in the header file:

struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;

And this line in the cpp file:

CTextureRenderer::CTextureRenderer(LPUNKNOWN unk, HRESULT *hr): CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer), "Texture Renderer", unk, hr)

Can you explain me how that all things work together?

Thank a lot.

anbuf
  • 91
  • 2
  • 8
  • The first is a definition of a class id, and the other extracts the uuid from the named struct (using a Microsoft extension). Can you be more specific about what you don't understand? – bmm6o Jun 06 '12 at 20:07

1 Answers1

2

This is Microsoft Visual C++ extension to C++, to aid COM programming. __declspec(uuid()) associates GUID structure with a class, and __uuidof yields GUID value of a given type/expression.

hamstergene
  • 24,039
  • 5
  • 57
  • 72