How do I have to configure UScreenCapture filter programmati

All the issues related to streaming of recorded media.

How do I have to configure UScreenCapture filter programmati

Postby alvaroBT » Thu Jul 13, 2017 1:49 am

Hello everybody.
I'm using the current version 2.0.18 of Screen Capture DirectShow source filter (UScreenCapture).
I'm programing in Microsoft visual c++ 2010
I have installed the filter in my PC and I have included the 'iscreencapture.h' header file into my project.
Then I use this code for inicializate the filter:

CComQIPtr<IUScreenCaptureSettings2> pIScreenCapture;

But when I try to compile it the code generate the folowing error:

Error 1 error C2787: 'IUScreenCaptureSettings2' : no GUID has been associated with this object. c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h

Can you help me?

Thanks!!
alvaroBT
 
Posts: 0
Joined: Thu Jul 13, 2017 1:33 am

Re: How do I have to configure UScreenCapture filter program

Postby admin » Thu Jul 13, 2017 9:42 am

#include <initguid.h> should help
admin
Site Admin
 
Posts: 835
Joined: Fri Aug 21, 2009 10:13 am

Re: How do I have to configure UScreenCapture filter program

Postby alvaroBT » Mon Jul 17, 2017 2:57 am

Thank you very much for you reply.
I include it but the compilation give me the same error:

Error 1 error C2787: 'IUScreenCaptureSettings2' : no GUID has been associated with this object. c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h

Any other idea?
alvaroBT
 
Posts: 0
Joined: Thu Jul 13, 2017 1:33 am

Re: How do I have to configure UScreenCapture filter program

Postby admin » Mon Jul 17, 2017 12:24 pm

Change your CComQIPtr declaration to the following:

CComQIPtr<IUScreenCaptureSettings2, &IID_IUScreenCaptureSettings2> pIScreenCapture;
admin
Site Admin
 
Posts: 835
Joined: Fri Aug 21, 2009 10:13 am

Re: How do I have to configure UScreenCapture filter program

Postby alvaroBT » Tue Jul 18, 2017 1:00 am

Thanks a lot for your help.

But don't work. The compilation give me the same error.

When I declare the object pIScreenCapture ('CComQIPtr<IUScreenCaptureSettings2, &IID_IUScreenCaptureSettings2> pIScreenCapture;') the code compile well but when I get the object via QueryInterface (of BaseFilter) then it not compile.
I'm going to write all code here for you check if is ok:
----------
int numMonitor = 2;
int framesPerSec = 24;
BOOL showCursor = FALSE;
CComQIPtr<IUScreenCaptureSettings2, &IID_IUScreenCaptureSettings2> pIScreenCapture;

// CComQIPtr<IUScreenCaptureSettings2> pIScreenCapture;

if((hr = uScreenCaptureFilter->QueryInterface(&pIScreenCapture)) != S_OK){
strTexto.Format(_T("Error al obtener el interfaz de las propiedades de vídeo UScrennCapture: %d. Código: 0x%X."), idxVideo, hr);
m_pGraphLog->escribirEnLog(TIPO_ERROR, _T("CDSFilterGraphHWImpl::crearGrafoCaptura"), strTexto, DETALLE_ALTO);
return hr;
}
else{
pIScreenCapture->put_MonitorNumber(numMonitor);
pIScreenCapture->put_FramesPerSec(framesPerSec);
pIScreenCapture->put_ShowCursor(showCursor);
pIScreenCapture.Release();
}
------------------------------------

Somthing is wrong in this code......but I don't know
Can you help me?
alvaroBT
 
Posts: 0
Joined: Thu Jul 13, 2017 1:33 am

Re: How do I have to configure UScreenCapture filter program

Postby admin » Tue Jul 18, 2017 10:21 am

1. Have #include "initguid.h"

2. Do you know what CComQIPtr is? You don't need to call QueryInterface because CComQIPtr does it internally when you use assignment operator.
So the correct code is: pIScreenCapture = uScreenCaptureFilter; //Wrong: uScreenCaptureFilter->QueryInterface(&pIScreenCapture)

3. This is not a programming forum. For use of COM and ATL, please refer to Microsoft programming forums.
admin
Site Admin
 
Posts: 835
Joined: Fri Aug 21, 2009 10:13 am

Re: How do I have to configure UScreenCapture filter program

Postby alvaroBT » Wed Jul 19, 2017 6:53 am

THANKS A LOT!!
Works fine!!!
I'm sorry. You have reason. I apologize for put here a code error, sorry again.
But thanks a lot for help me to solve this problem.

Regards!
alvaroBT
 
Posts: 0
Joined: Thu Jul 13, 2017 1:33 am


Return to Streaming Files

Who is online

Users browsing this forum: No registered users and 1 guest

cron