Thursday, April 19, 2007

CBaseOutputpin Error

Error 1:...


d:\Samples\SyncFilter_Backup\SyncFilter.h(213) : error C2695: 'cvSyncOutputPin::Notify': overriding virtual function differs from 'CBasePin::Notify' only by calling convention


class cvSyncOutputPin : public CBaseOutputPin
{

public :
HRESULT Notify(IBaseFilter * pSender, Quality q);
};


Solution :


class cvSyncOutputPin : public CBaseOutputPin
{

public :
STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);
};




Error 2 :
---------------
d:\Samples\SyncFilter_Backup\SyncFilter.h(202) : error C2440: 'initializing' : cannot convert from 'CBaseFilter *'

to 'SyncFilter1 *'

code :
------------
cvSyncOutputPin(TCHAR *pObjectName,
CBaseFilter *pFilter,
CCritSec *pLock,
HRESULT* hr,
LPCWSTR pName
):CBaseOutputPin(pObjectName,
(CBaseFilter*)pFilter,
pLock,
hr,
pName), m_pFilter(pFilter)
{


};


Solution code :
-------------

cvSyncOutputPin(TCHAR *pObjectName,
CBaseFilter *pFilter,
CCritSec *pLock,
HRESULT* hr,
LPCWSTR pName
):CBaseOutputPin(pObjectName,
(CBaseFilter*)pFilter,
pLock,
hr,
pName), m_pFilter((SyncFilter1*)pFilter)
{


};



1.CheckMediaType() is an important fn in any filter it can change the result of an entire video




unsafe code error :
----------------------
CSHarp I got the folloing error :

Error :Build with unsafe code problem
Solution :

Go to Project -> Properties and then to the Build Tab. Ensure for all Configurations (on the top of this page) the Allow unsafe code check box is checked. If it is not checked for one of the configurations and Team Build is setup to build that configuration then your build will fail with this error.

No comments: