Adi Shavit 
| Hi,
I'm trying to use COMSTL with DirectShow, and I'm having compilation problems right from the start.
I took a simple working DirectShow (which is based on COM) program (on
MSVC++ 6.0), and tried adding a single line to see COMSTL in action.
My code snippet:
//...
IGraphBuilder *pGraph;
IMediaEvent *pEvent;
//...
using namespace comstl;
CoInitialize(NULL);
pGraph= 0;
if (!FAILED(
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraph))) {
//...
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
if (interface_cast_test<IMediaEvent>(pGraph)) //<< COMSTL usage
int j=0; //dummy code
//...
uses of interface_case_addref<> give similar problems.
Here's a sample of my errors:
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : error C2259: 'IMediaEvent' : cannot instantiate abstract class due to following members:
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(662) : see declaration of 'IMediaEvent'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IUnknown::QueryInterface(const struct _GUID &,void ** )' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(109) : see declaration of 'QueryInterface'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'unsigned long __stdcall IUnknown::AddRef(void)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(113) : see declaration of 'AddRef'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'unsigned long __stdcall IUnknown::Release(void)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(115) : see declaration of 'Release'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IDispatch::GetTypeInfoCount(unsigned int *)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\oaidl.h(2697) : see declaration of 'GetTypeInfoCount'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IDispatch::GetTypeInfo(unsigned int,unsigned long,struct ITypeInfo ** )' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\oaidl.h(2700) : see declaration of 'GetTypeInfo'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IDispatch::GetIDsOfNames(const struct _GUID &,unsigned short ** ,unsigned int,unsigned long,long *)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\oaidl.h(2705) : see declaration of 'GetIDsOfNames'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IDispatch::Invoke(long,const struct _GUID &,unsigned long,unsigned short,struct tagDISPPARAMS *,struct tagVARIANT *,struct tagEXCEPINFO *,unsign
ed int *)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\oaidl.h(2712) : see declaration of 'Invoke'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::GetEventHandle(long *)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(665) : see declaration of 'GetEventHandle'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::GetEvent(long *,long *,long *,long)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(668) : see declaration of 'GetEvent'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::WaitForCompletion(long,long *)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(674) : see declaration of 'WaitForCompletion'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::CancelDefaultHandling(long)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(678) : see declaration of 'CancelDefaultHandling'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::RestoreDefaultHandling(long)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(681) : see declaration of 'RestoreDefaultHandling'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(302) : warning C4259: 'long __stdcall IMediaEvent::FreeEventParams(long,long,long)' : pure virtual function was not defined
c:\users\adish\gentech\libs\iplreader\directx8\include\control.h(684) : see declaration of 'FreeEventParams'
c:\users\adish\gentech\otherlibs\stlsoft\comstl\interface_cast.hpp(515) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_base<struct IMediaEvent,struct stlsoft::comstl_project::noaddref_release<struct
IMediaEvent>,struct stlsoft::comstl_project::ignore_interface_cast_exception>' being compiled
c:\users\adish\tests\cvision2\cvapp.h(79) : see reference to class template instantiation 'stlsoft::comstl_project::interface_cast_test<struct IMediaEvent>' being compiled
Am I doing something wrong?
Thanks,
Adi
|