class DemoBatchQueueItem;
typedef CComObject<DemoBatchQueueItem> CComObjectDemoBatchQueueItem;
virtual bool execute();
BatchQueueItem("Demo Batch Queue Item","1.0")
STDMETHOD(get_Version)(BSTR * pVal)
{
if (pVal == NULL)
{
return E_POINTER;
}
*pVal = CComBSTR("1.0").Detach();
return S_OK;
}
STDMETHOD(create)(ULONG Index, IBatchQueueItem * * pVal)
{
if (pVal == NULL)
{
return E_POINTER;
}
if (Index == 0)
{
CComObjectDemoBatchQueueItem *temp;
CComObjectDemoBatchQueueItem::CreateInstance(&temp);
temp->AddRef();
*pVal = temp;
return S_OK;
}
return E_INVALIDARG;
}
STDMETHOD(get_NumberOfFileTypes)(ULONG * pVal)
{
if (pVal == NULL)
{
return E_POINTER;
}
*pVal = 1;
return S_OK;
}
STDMETHOD(get_FileType)(ULONG Index, BSTR * pVal)
{
if (pVal == NULL)
{
return E_POINTER;
}
if (Index == 0)
{
*pVal = CComBSTR("bqdemo").Detach ();
return S_OK;
}
return E_INVALIDARG;
}
DemoBatch_CPP_6_0.DemoBatchQueueItemCreator
Please note that when you wish to compile your plug-in for release you may find that you have an unresolved external symbol _main. If this is the case remove the pre-processor definition _ATL_MIN_CRT (Project Settings->C/C++ Tab, Pre-processor Category - Pre-processor Definitions) then recompile.
If you wish to add logging information to your batch queue item object you can call the log method at any point. All logging entries from configuration to sever will be displayed in the logger view window and in the log file. If you wish to add debug log entries then use levels finest, finer and fine levels and change the logging level via the Logging->Set Logging Level option.
You can download the demo plug-in at: - http://www.TestScriptRunner.com/zipfiles/VCPP_6_0_DemoBatchQueueItem.zip.