Saberinth

Hi,

I'm new to filter Developement.

I created a custom filter from the using the sample grabber example and registered the filter.ax file i can ad the filter to the graph by using

Code Snippet

// {13479B17-52C2-4e86-8165-477E90C162A2}

DEFINE_GUID(CLSID_RecogSampler,

0x13479b17, 0x52c2, 0x4e86, 0x81, 0x65, 0x47, 0x7e, 0x90, 0xc1, 0x62, 0xa2);

// {C784B75F-AD5A-4478-9AE6-01F5FE62591E}

DEFINE_GUID(IID_IRecogSampler,

0xc784b75f, 0xad5a, 0x4478, 0x9a, 0xe6, 0x1, 0xf5, 0xfe, 0x62, 0x59, 0x1e);

then using the AddFilterbyCLSID function

Code Snippet

hr = AddFilterByCLSID( pGraph, CLSID_RecogSampler, L"Recog Sampler", &pGrabF );

if( FAILED( hr ) )

{

return hr;

}

How do I define a object of the class IRecogSampler so I can use the

filter's functions from the application

in filter.h

Code Snippet

typedef HRESULT (*SAMPLECALLBACK) (

IMediaSample * pSample,

REFERENCE_TIME * StartTime,

REFERENCE_TIME * StopTime,

BOOL TypeChanged );

// We define the interface the app can use to program us

MIDL_INTERFACE("C784B75F-AD5A-4478-9AE6-01F5FE62591E")

IRecogSampler : public IUnknown

{

public:

virtual HRESULT STDMETHODCALLTYPE SetAcceptedMediaType(

const CMediaType *pType) = 0;

virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType(

CMediaType *pType) = 0;

virtual HRESULT STDMETHODCALLTYPE SetCallback(

SAMPLECALLBACK Callback) = 0;

virtual HRESULT STDMETHODCALLTYPE SetDeliveryBuffer(

ALLOCATOR_PROPERTIES props,

BYTE *pBuffer) = 0;

};

thanx in advance




Re: DirectShow Development Custom Filter Interface

Saberinth

Ok I added

this to my code

Code Snippet

#include "..\..\Recog Sampler\Recog Sampler\Recog Sampler.h"

and added the ..\Recog Sampler\Debug\Recog Sampler.lib and Release to the linker

the Errors I'm receiving with this is...

Error 6 error LNK2001: unresolved external symbol _CLSID_RecogSampler Switch2Store.obj

Error 7 error LNK2001: unresolved external symbol _IID_IRecogSampler Switch2Store.obj

Error 8 fatal error LNK1120: 2 unresolved externals E:\Documents and Settings\dewald\My Documents\Visual Studio 2005\Projects\retry\Switch2Store\Release\Switch2Store.exe

Error 14 error LNK2001: unresolved external symbol _IID_IRecogSampler Switch2Store.obj

Error 15 error LNK2001: unresolved external symbol _CLSID_RecogSampler Switch2Store.obj

Error 16 fatal error LNK1120: 2 unresolved externals E:\Documents and Settings\dewald\My Documents\Visual Studio 2005\Projects\retry\Switch2Store\Debug\Switch2Store.exe

The Filter is registered with regsvr32 "Recog Sampler.ax"

please any help will be appreciated

thanx in advance






Re: DirectShow Development Custom Filter Interface

LGS

Does this describe your problem

http://support.microsoft.com/kb/130869





Re: DirectShow Development Custom Filter Interface

Saberinth

Yeah, thanks I used guiddef.h instead of initguid.h

thanks for the help