Infognition forum
February 11, 2012, 06:15:15 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: generated c++ doesn't compile -- please help a newbie  (Read 934 times)
ron
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« on: April 06, 2010, 09:57:52 PM »

Hi: I'm a new user to grapheditplus (and Directshow in general). I am trying to get a simple samplegrabber program to compile. Near as I can tell, the problem is with the code that generates the pointer to the samplegrabber filter.

The graph I am using is:

Video capture ---> AVI Decompressor --> sampleGrabber --> video Renderer

The errors are:
1>c:\documents and settings\ron\desktop\capture\capture\capture.cpp(125) : error C2065: 'ISampleGrabber' : undeclared identifier
1>c:\documents and settings\ron\desktop\capture\capture\capture.cpp(125) : error C2065: 'IID_ISampleGrabber' : undeclared identifier
1>c:\documents and settings\ron\desktop\capture\capture\capture.cpp(125) : error C2514: 'ATL::CComQIPtr' : class has no constructors
1>        c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcomcli.h(493) : see declaration of 'ATL::CComQIPtr'
1>c:\documents and settings\ron\desktop\capture\capture\capture.cpp(126) : error C2039: 'SetMediaType' : is not a member of 'ATL::_NoAddRefReleaseOnCComPtr<T>'

where lines 125 & 126 are:

   CComQIPtr<ISampleGrabber, &IID_ISampleGrabber> pSampleGrabber_isg(pSampleGrabber);
    hr = pSampleGrabber_isg->SetMediaType(&pSampleGrabber_pmt);

I can provide the full source code / graph file if needed.
I can get the IID_ISampleGrabber error to go away if I define the following (I don't know if this
is the correct value -- I found it googling):

static const GUID IID_ISampleGrabber =
{ 0xe784f5dc, 0xa11, 0x4c4f, { 0xbd, 0xa8, 0x15, 0xb8, 0xb, 0xe3, 0xd8, 0xc6 } }

Two questions: any idea how to fix the CComQIPtr definition so it compiles?
And How do you find the IID definitions?

Thanks

-ron
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 517



View Profile WWW
« Reply #1 on: April 07, 2010, 03:22:23 PM »

Obviously you don't have proper header files in place.
You need to have DirectShow development stuff installed, you can get it by installing "Windows SDK".
After you install Windows SDK, alter your C++ project settings by adding include path to DirectShow header files, adding linking path to DirectShow lib files and linking strmiids.lib and quartz.lib.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!