A Video for Windows ActiveX Control by Ofer LaOr Listing One [ hidden, uuid(54526101-F0CA-11d1-969F-002018631632) ] dispinterface _oVFWEvents { properties: methods: [id(1)] void DriversEnum([in]long index, [in]IoVFWDriverInfo* driver); }; Listing Two coclass oVFW { [default] interface IoVFW; [default, source] dispinterface _oVFWEvents; }; Listing Three class ATL_NO_VTABLE CoVFW : public CComObjectRootEx, public CComCoClass, public CComControl, public CStockPropImpl, public IProvideClassInfo2Impl<&CLSID_oVFW, &DIID__oVFWEvents, &LIBID_oVFW>, public IPersistStreamInitImpl, public IPersistStorageImpl, public IQuickActivateImpl, public IOleControlImpl, public IOleObjectImpl, public IOleInPlaceActiveObjectImpl, public IViewObjectExImpl, public IOleInPlaceObjectWindowlessImpl, public IDataObjectImpl, public ISupportErrorInfo, public IConnectionPointContainerImpl, public CProxy_oVFWEvents, public ISpecifyPropertyPagesImpl { Listing Four EXTERN_C const IID DIID__oVFWEvents= { 0x54526101, 0xf0ca, 0x11d1, { 0x96, 0x9f, 0x0, 0x20, 0x18, 0x63, 0x16, 0x32 } }; Listing Five BEGIN_CONNECTION_POINT_MAP(CoVFW) CONNECTION_POINT_ENTRY(DIID__oVFWEvents) END_CONNECTION_POINT_MAP() Listing Six pDriverInfo= new CComObject; dynamic_cast(pDriverInfo)->AddRef(); Listing Seven dynamic_cast(pDriverInfo)->Release(); Listing Eight return Error( _T("oVFWDriverInfo: bad driver information object"), IID_IoVFWDriverInfo, CUSTOM_CTL_SCODE(1009)); Listing Nine Set Picture1.Picture = Clipboard.GetData(vbCFDIB) Listing Ten ...RGS stuff here... ForceRemove {5A5FFDB1-F0A7-11D1-969F-002018631632} = s 'oVFW control' { ...additional RGS stuff here... ForceRemove 'Implemented Categories' { ForceRemove '{7DD95801-9882-11CF-9FA9-00AA006C42C4}' ForceRemove '{7DD95802-9882-11CF-9FA9-00AA006C42C4}' } } Listing Eleven

Ofer LaOr - VFW

2