//this part is only done once
//if you need to use the GUID in another file, just include Guid.h
#pragma data_seg(".text")
#define INITGUID
#include <initguid.h>
#include <shlguid.h>
#include "Guid.h"
#pragma data_seg()
/**************************************************************************
private function prototypes
**************************************************************************/
/**************************************************************************
global variables
**************************************************************************/
//if we don't support this classid, return the proper error code
if( !IsEqualCLSID(rclsid, CLSID_SampleToolBand))
return CLASS_E_CLASSNOTAVAILABLE;
//create a CClassFactory object and check it for validity
CClassFactory *pClassFactory = new CClassFactory(rclsid);
if(NULL == pClassFactory)
return E_OUTOFMEMORY;
//get the QueryInterface return for our return value
HRESULT hResult = pClassFactory->QueryInterface(riid, ppReturn);
//call Release to decement the ref count - creating the object set it to one
//and QueryInterface incremented it - since its being used externally (not by
//us), we only want the ref count to be 1
pClassFactory->Release();
//return the result from QueryInterface
return hResult;
}