#include "PRINTSDK.h"
/*****************************************************************************
* CPrintFunc class definition
*****************************************************************************/
class CPrintFunc
{
private:
CPrintPreset* m_pPrintPreset;
PRINT_PRESETDATA* m_pPresetItemList;
long m_lPresetCount;
PPrint_PRINTERTYPE m_PrintPrinterType; /* Printer Type */
/*************************************************************************
* Internal Methods
*************************************************************************/
// create CPrintPreset class object
PRINTERROR CreatePrintSdk();
public:
// Constructor
CPrintFunc();
// Destructor
virtual ~CPrintFunc();
/*************************************************************************
* Methods
*************************************************************************/
// get printdata from PRINT
SDK
PRINTERROR GetData(
HPUTIL_STR1023 &out_AlertString,
PRINT_DATAINF &out_DataInf);
}
/*****************************************************************************
* Internal Methods
*****************************************************************************/
/*****************************************************************************
* ID = CPrintFunc::CreatePrintSdk()
* func = create CPrintPreset class object
*****************************************************************************/
PRINTERROR
CPrintFunc::CreatePrintSdk()
{
if(m_pPrintPreset) return(PRINTERROR_NOERROR);
try {
m_pPrintPreset = new CPrintPreset(PRINT_INTERNAL_VERSION);
if(!m_pPrintPreset) {
return(PRINTERROR_MEMORY);
}
}
catch(...){
return(PRINTERROR_MEMORY);
}
return(PRINTERROR_NOERROR);
}
/*****************************************************************************
* ID = CPrintFunc::GetData()
* func = get printdata from PRINT
SDK
*****************************************************************************/
PRINTERROR
CPrintFunc::GetData(
HPUTIL_STR1023 &out_AlertString,
PRINT_DATAINF &out_DataInf)
{
PRINTERROR lPrintError = PRINTERROR_NOERROR;
lPrintError = CreatePrintSdk();
if(lPrintError != PRINTERROR_NOERROR) {
return(lPrintError);
}
lPrintError = m_pPrintPreset->PRINT_GetData(out_AlertString, out_DataInf);
return(lPrintError);
}