#pragma once
#include "stdafx.h"
#ifdef _DEBUG
#include <iostream>
#endif
#include <vector>

/***************** 全局实参定义  ********************/
#define MAX_PATH_LENGTH  256

//#define DDD
//regidit key define
#ifdef DDD
#define KEY_ROOT             HKEY_LOCAL_MACHINE
#define SUB_KEY_PARENT        TEXT("Software\\VirtualPrinter")
#define REGEDIT_EXE_PATH      _T("extapp")
#define LOAD_APP_FLAG         _T("load_extapp")
#define EXE_NAME              _T("\\HealthHutUi.exe")
#define IMAGE_PATH_SUBSTREET
//app regedit key
#define APP_KEY_ROOT          TEXT("Software\\HealthHut")
#define APP_PATH             _T("exepath")
#define KEY64                KEY_WOW64_64KEY
#else
#define KEY_ROOT             HKEY_USERS
#define SUB_KEY_PARENT        TEXT("S-1-5-21-1446433350-3466257332-1372034800-1000\\Software\\ImagePrinter")
#define REGEDIT_EXE_PATH      _T("ext_app_name")
#define LOAD_APP_FLAG         _T("ext_app")
#define EXE_NAME              _T("\\HealthHutUi.exe")
#define IMAGE_PATH_SUBSTREET
#define KEY64  0
//app regedit key
#define APP_KEY_ROOT          TEXT("Software\\HealthHut")
#define APP_PATH             _T("exepath")
#endif
/***************** end   ********************/


/***************   functions define  *********/
extern void GetAppPath(WCHAR *path);
extern void LpbyteToCString(LPBYTE value, CString& result, int length);
extern void ShowErrBox(DWORD err);
extern int  Login();
extern int  search(CString& name, CString& id_card);
extern std::vector<CString>& getNames();
extern std::vector<CString>& getIds();
extern bool util_upload(CString& name, CString id, CString path);

/***************   end  *********/


/***************  全局通用宏定义  ***************/
#ifdef _DEBUG
#define DEBUG_OUT(msg) \
	do{\
	std::cout<<msg<<std::endl;\
	} while(0)

#define DEBUG_OUTW(msg)\
	do{\
	std::wcout<<msg<<std::endl;\
	} while(0)
#else
#define DEBUG_OUTW(msg)
#define DEBUG_OUT(msg)
#endif

#define safe_delete(point) \
do {\
	if (NULL != point) {\
		delete point;\
	}\
} while(0);
/***************  end  ***************/