42
Argus Encoder Family Version 2.6 API Developer’s Guide
FMTestApp
properties and events exposed through the primary Filter Manager interface.
For a more thorough discussion of Smart Pointers, refer to
ATL Internals
, by
Rector and Sells.
The CFMInterface Class
For ease of use, we’ve encapsulated the interface-creation process described
above in a class, CFMInterface. This class handles the instantiation and manip-
ulation of the Filter Manager interface. You can easily include this class, if you
choose, in any C++ application that uses the Filter Manager COM component.
To do so, just copy the class definition and all of the method definitions (the
first five methods defined in FilterManagerCalls.cpp) into your project. You’ll
need to eliminate or replace any specific references to our Windows Dialog
class, CFMTestAppDlg. To access Filter Manager methods using CFMInter-
face, just retrieve the Filter Manager Smart Pointer by calling
GetFMPointer()
,
then use the retrieved pointer to reference the method that you need.
Of course, using the CFMInterface class is just an option. You could just as easily
create the Filter Manager Smart Pointer on your own.
/***************************************************************
The CFMInterface class handles the registration of COM, the instantiation of the
FilterManager COM interface, and the registration of Filter Manager events
***************************************************************/
class CFMInterface
{
public:
CFMInterface();
int Create( CFMTestAppDlg *pApp );
int CleanUp();
IArgusFM *Get FM Pointer();
SetWindowPointer( CFMTestAppDlg *pVal );
encode_state_t GetEncoderState(){ return EncoderState;}
void SetEncoderState( encode_state_t val )
{ EncoderState = val; }
private:
bool
bCleanedUp;
encode_state_t
EncoderState;
IDispatch
*pID;
DWORD
m_dwCookie;