#include <windows.h>
#define DRAWER_IS_OPEN    48
#define DRAWER_IS_CLOSED  49

 __declspec( dllimport ) BOOLEAN WINAPI UsbCashDrawer(DWORD CashDrawerNum);

 __declspec( dllimport ) DWORD WINAPI UsbCashDrawerStaus(DWORD CashDrawerNum);


void main()
{
  DWORD ret;

  //ret=TRUE  -> open successful
  //ret=FALSE -> open failed
  ret=UsbCashDrawer(1);//open the first cash drawer

  //ret=0  -> Get Status Failed
  //ret=48 -> USB cash drawer 1 is open
  //ret=49 -> USB cash drawer 1 is closed
  ret=UsbCashDrawerStaus(1);

 

  //ret=TRUE  -> open successful
  //ret=FALSE -> open failed
  ret=UsbCashDrawer(2);//open the second cash drawer

  //ret=0  -> Get Status Failed
  //ret=48 -> USB cash drawer is 2 open
  //ret=49 -> USB cash drawer is 2 closed
  ret=UsbCashDrawerStaus(2);

  UsbCashDrawer(3);//open the third cash drawer
  UsbCashDrawer(4);//open the fourth cash drawer
  UsbCashDrawer(5);//open the fifth cash drawer

}