0

I'm trying to execute a code generated by graphEditPlus (using VS2010) but having a trouble with the following line:

CComQIPtr<ISampleGrabber, &IID_ISampleGrabber> pSampleGrabber_isg(pSampleGrabber);

where the errors are: error C2065: 'ISampleGrabber' : undeclared identifier error C2065: 'IID_ISampleGrabber' : undeclared identifier error C2514: 'ATL::CComQIPtr' : class has no constructors

I tried downloading different versions of Windows SDK (V7.1, V6.0A, V5) and set the include / lib paths but still having the same problem!

Is the SampleGrabber still being supported? Mainly, the SampleGrabber is used in my code to grab frames from a video capturing source...

Thanks for your assistance...

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Basel
  • 151
  • 9
  • Does [this link](http://msdn.microsoft.com/en-us/library/windows/desktop/dd376984(v=vs.85).aspx) help ? – Jabberwocky Apr 24 '14 at 22:55
  • I have finally managed to restore qedit.h from old SDK versions (V5, V6.0) and use ifndef/def for the missing "dxtrans.h". This solved the problem partially but now I'm getting the following:error C2970: 'ATL::CComQIPtr' : template parameter 'piid' : 'IID_ISampleGrabber' : an expression involving objects with internal linkage cannot be used as a non-type argument – Basel Apr 25 '14 at 23:29

1 Answers1

1

Microsoft deprecated Sample Grabber and the entire DES API, however you if you import the type library, or just copy the declarations into your project - the component is still usable except some very latest OS releases (Windows Server 2008?) where it is completely gone and you might need another solution such as building your own from earlier SDK samples.

See ISampleGrabber deprecated: where can I find alternatives? for more information.

See also RenderWmvVideo.cpp with code fragment to copy/paste and re-add the declarations to your project (#pragma section at the top of the file):

#pragma region Windows SDK Tribute, qedit.h

struct __declspec(uuid("0579154a-2b53-4994-b0d0-e773148eff85"))
ISampleGrabberCB : IUnknown
{

...

#pragma endregion
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Thanks @Roman, I'm assuming the pragma section is added in your code to avoid including qedit.h . This helps in defining them as the case when including it, I end up getting error C2970: 'ATL::CComQIPtr' : template parameter 'piid' : 'IID_ISampleGrabber' : an expression involving objects with internal linkage cannot be used as a non-type argument. Anyway pSampleGrabber_isg is aimed to set the media type and it seems when commenting this line, I'm able to run the code successfully. – Basel Apr 26 '14 at 00:01
  • As ISampleGrabber is now successfully defined, I'll consider your answer as a working solution. Thank you! – Basel Apr 26 '14 at 00:08
  • `CComQIPtr` is sufficient. You have to use `, IID_...` for [older] interfaces defined without attaching UUID to them. – Roman R. Apr 26 '14 at 10:48