//////////////////////////////////////////////////////////////////////////
//Export Function
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

void UnloadDll();
BOOL LoadDll();

#define BXLPTR_API __declspec(dllimport)

typedef long (*pPrinterOpen)(LPCTSTR strOutPortName, long lTimeout);
typedef long (*pPrinterClose)();

typedef long (*pPrintText)(LPCTSTR Data, long Alignment, long Attribute, long TextSize);
typedef long (*pLineFeed)(int nFeed);
typedef long (*pPrintBitmap)(LPCTSTR FileName, long Width, long Alignment, long Level);
typedef long (*pPrintBarcode)(PCHAR Data, long Symbology, long Height, long Width, long Alignment, long TextPosition);

typedef long (*pSetCharacterSet)(long Value);
typedef long (*pSetInterChrSet)(long Value);
typedef long (*pGetCharacterSet)();
typedef long (*pGetInterChrSet)();	

typedef long (*pSetUpsideDown)(long mode);
typedef long (*pSetLeftMargin)(long margin);
typedef long (*pSetPrintWidth)(long width);

typedef long (*pDirectIO)(PCHAR Data, UINT uiWrite, PCHAR pRequest, UINT& uiRead);

typedef long (*pMsrReadReady)();
typedef long (*pMsrReadCancel)();
typedef long (*pMsrReadTrack)(PCHAR Data1,PCHAR Data2,PCHAR Data3);
typedef long (*pMsrReadFullTrack)(PCHAR Data1, UINT uiLen);
typedef long (*pMsrRead1Track)(PCHAR Data1, UINT uiLen);
typedef long (*pMsrRead2Track)(PCHAR Data1, UINT uiLen);
typedef long (*pMsrRead3Track)(PCHAR Data1, UINT uiLen);
typedef long (*pGetTrack1)(TCHAR* tcData, UINT uiLen);
typedef long (*pGetTrack2)(TCHAR* tcData, UINT uiLen);
typedef long (*pGetTrack3)(TCHAR* tcData, UINT uiLen);

typedef bool (*pSetMsrMessageValue)(long lValue);
typedef long (*pGetMsrMessageValue)();
typedef long (*pSetMsrMsgMode)(BOOL bValue);

typedef long (*pGetPowerValue)();
typedef long (*pGetStat)();
typedef long (*pCheckPrinter)();
typedef long (*pGetResultCode)();


typedef long (*pFormFeed) (int nFeed);
typedef long (*pNextPrintPos)();
typedef long (*pInitializePrinter) () ;
typedef long (*pSelectMode) (BOOL bLabelMode);
typedef long (*pAutoCalibration) ();


typedef long (*pSelectPageMode) (BOOL bPageMode);
typedef long (*pSetPrintAreaInPageMode) (long x, long y, long width, long height);
typedef long (*pSelectPrintDirectionInPageMode) (long printDirection);
typedef long (*pSetAbsoluteVerticalPrintPositionInPageMode) (long motionUnit);
typedef long (*pSetAbsolutePrintPosition) (long motionUnit);
typedef long (*pPrintDataInPageMode) ();

typedef long (*pSetPrintAreaInPM) (long x, long y, long width, long height);
typedef long (*pSetPrintDirectionInPM) (long printDirection);
typedef long (*pSetVerticalPositionInPM) (long motionUnit);
typedef long (*pSetHorizontalPositionInPM) (long motionUnit);

////////////  SCR
typedef long (*pScrPowerDown)(PCHAR ResponseS);
typedef long (*pScrPowerUp)(PCHAR pATR, UINT& ATRLen, PCHAR ResponseS);
typedef long (*pScrExchangeAPDU)(PCHAR pCmdAPDU, UINT cmdAPDULen, PCHAR pRspAPDU, UINT& rspAPDULen, PCHAR ResponseS);
typedef long (*pScrOperationMode)(UINT mode, PCHAR ResponseS);
typedef long (*pScrChkCardStatus)(PCHAR pStatus, PCHAR ResponseS);



extern HMODULE			m_hDll;

extern pPrinterOpen		PrinterOpen;	
extern pPrinterClose	PrinterClose;

extern pPrintText		PrintText;
extern pLineFeed		LineFeed;		
extern pPrintBitmap		PrintBitmap;	
extern pPrintBarcode	PrintBarcode;		
		
extern pSetCharacterSet	SetCharacterSet;
extern pSetInterChrSet	SetInterChrSet;	
extern pGetCharacterSet	GetCharacterSet;
extern pGetInterChrSet	GetInterChrSet;	

extern pSetUpsideDown	SetUpsideDown;
extern pSetLeftMargin	SetLeftMargin;
extern pSetPrintWidth	SetPrintWidth;

extern pDirectIO		DirectIO;	

extern pMsrReadReady	 MsrReadReady;	
extern pMsrReadCancel	 MsrReadCancel;	
extern pMsrReadTrack	 MsrReadTrack;
extern pMsrReadFullTrack MsrReadFullTrack;
extern pMsrRead1Track	 MsrRead1Track;
extern pMsrRead2Track	 MsrRead2Track;
extern pMsrRead3Track	 MsrRead3Track;
extern pGetTrack1		 GetTrack1;
extern pGetTrack2		 GetTrack2;
extern pGetTrack3		 GetTrack3;

extern pSetMsrMessageValue	SetMsrMessageValue; 
extern pGetMsrMessageValue	GetMsrMessageValue;
extern pSetMsrMsgMode		SetMsrMsgMode;

extern pCheckPrinter	CheckPrinter;	
extern pGetPowerValue	GetPowerValue;	
extern pGetStat			GetStat;
extern pGetResultCode	GetResultCode;
	

extern pFormFeed			FormFeed;
extern pNextPrintPos		NextPrintPos;	
extern pInitializePrinter	InitializePrinter;
extern pSelectMode			SelectMode;
extern pAutoCalibration		AutoCalibration;


extern pSelectPageMode					SelectPageMode;
extern pSetPrintAreaInPageMode			SetPrintAreaInPageMode;
extern pSelectPrintDirectionInPageMode	SelectPrintDirectionInPageMode;
extern pSetAbsolutePrintPosition		SetAbsolutePrintPosition;
extern pSetAbsoluteVerticalPrintPositionInPageMode SetAbsoluteVerticalPrintPositionInPageMode;
extern pPrintDataInPageMode				PrintDataInPageMode;

extern pSetPrintAreaInPM			SetPrintAreaInPM;
extern pSetPrintDirectionInPM		SetPrintDirectionInPM;
extern pSetVerticalPositionInPM		SetVerticalPositionInPM;
extern pSetHorizontalPositionInPM	SetHorizontalPositionInPM;


extern pScrPowerDown ScrPowerDown;
extern pScrPowerUp ScrPowerUp;
extern pScrExchangeAPDU ScrExchangeAPDU;
extern pScrOperationMode ScrOperationMode;
extern pScrChkCardStatus ScrChkCardStatus;