135 lines
No EOL
4.3 KiB
C++
135 lines
No EOL
4.3 KiB
C++
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
|
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
|
// 들어 있는 포함 파일입니다.
|
|
|
|
#pragma once
|
|
|
|
#ifndef _SECURE_ATL
|
|
#define _SECURE_ATL 1
|
|
#endif
|
|
|
|
#ifndef VC_EXTRALEAN
|
|
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
|
|
#endif
|
|
|
|
// 아래 지정된 플랫폼에 우선하는 플랫폼을 대상으로 하는 경우 다음 정의를 수정하십시오.
|
|
// 다른 플랫폼에 사용되는 해당 값의 최신 정보는 MSDN을 참조하십시오.
|
|
#ifndef WINVER // Windows XP 이상에서만 기능을 사용할 수 있습니다.
|
|
#define WINVER 0x0501 // 다른 버전의 Windows에 맞도록 적합한 값으로 변경해 주십시오.
|
|
#endif
|
|
|
|
#ifndef _WIN32_WINNT // Windows XP 이상에서만 기능을 사용할 수 있습니다.
|
|
#define _WIN32_WINNT 0x0501 // 다른 버전의 Windows에 맞도록 적합한 값으로 변경해 주십시오.
|
|
#endif
|
|
|
|
#ifndef _WIN32_WINDOWS // Windows 98 이상에서만 기능을 사용할 수 있습니다.
|
|
#define _WIN32_WINDOWS 0x0410 // Windows Me 이상에 맞도록 적합한 값으로 변경해 주십시오.
|
|
#endif
|
|
|
|
#ifndef _WIN32_IE // IE 6.0 이상에서만 기능을 사용할 수 있습니다.
|
|
#define _WIN32_IE 0x0600 // 다른 버전의 IE에 맞도록 적합한 값으로 변경해 주십시오.
|
|
#endif
|
|
|
|
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 일부 CString 생성자는 명시적으로 선언됩니다.
|
|
|
|
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
|
|
#define _AFX_ALL_WARNINGS
|
|
|
|
#include <afxwin.h> // MFC 핵심 및 표준 구성 요소입니다.
|
|
#include <afxext.h> // MFC 확장입니다.
|
|
|
|
|
|
#include <afxdisp.h> // MFC 자동화 클래스입니다.
|
|
|
|
|
|
|
|
#ifndef _AFX_NO_OLE_SUPPORT
|
|
#include <afxdtctl.h> // Internet Explorer 4 공용 컨트롤에 대한 MFC 지원입니다.
|
|
#endif
|
|
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
|
#include <afxcmn.h> // Windows 공용 컨트롤에 대한 MFC 지원입니다.
|
|
#endif // _AFX_NO_AFXCMN_SUPPORT
|
|
|
|
#ifdef _UNICODE
|
|
#if defined _M_IX86
|
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
|
#elif defined _M_IA64
|
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
|
#elif defined _M_X64
|
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
|
#else
|
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
|
#endif
|
|
#endif
|
|
|
|
#define _SERVICEMANAGER_EX
|
|
|
|
////////////////////////////////////////////////////////////////
|
|
//network library
|
|
#include <direct.h>
|
|
#include <io.h>
|
|
#include <mmsystem.h>
|
|
|
|
#include "DNDefine.h"
|
|
#include "DNHeader.h"
|
|
//#include "DNPacket.h"
|
|
//#include "DNProtocol.h"
|
|
#include "minidump.h"
|
|
//#include "CommonMacros.h"
|
|
#include "ServiceUtil.h"
|
|
#include <afxcview.h>
|
|
|
|
#ifndef UNICODE
|
|
#define std_str std::string
|
|
#else
|
|
#define std_str std::wstring
|
|
#endif
|
|
|
|
inline void _wcscpy(WCHAR * pDest, const void * pSrc, int nLen)
|
|
{
|
|
if (nLen > 0)
|
|
memcpy(pDest, pSrc, nLen*sizeof(WCHAR));
|
|
pDest[nLen] = '\0';
|
|
}
|
|
|
|
inline void _strcpy(char * pDest, const void * pSrc, int nLen)
|
|
{
|
|
if (nLen > 0)
|
|
memcpy(pDest, pSrc, nLen);
|
|
pDest[nLen] = '\0';
|
|
}
|
|
|
|
|
|
static unsigned long _inet_addr(const WCHAR * cp)
|
|
{
|
|
int s_b[4] = { 0, 0, 0, 0};
|
|
struct in_addr in;
|
|
swscanf(cp, L"%d.%d.%d.%d", &s_b[0], &s_b[1], &s_b[2], &s_b[3]);
|
|
in.S_un.S_un_b.s_b1 = s_b[0];
|
|
in.S_un.S_un_b.s_b2 = s_b[1];
|
|
in.S_un.S_un_b.s_b3 = s_b[2];
|
|
in.S_un.S_un_b.s_b4 = s_b[3];
|
|
return in.S_un.S_addr;
|
|
}
|
|
|
|
int GetServerType(const WCHAR * pType);
|
|
int GetMonitorLevel(const WCHAR * pLevel);
|
|
int GetSIDType(const WCHAR * pwszType);
|
|
|
|
int GetServerTypeForConvert(const WCHAR * pType);
|
|
|
|
struct tm _wtotm(const WCHAR * pTimeFromSql);
|
|
time_t _wtoTime_t(const WCHAR * pTimeFromSql);
|
|
|
|
extern void _WriteLog( int nLogType, const char *szStr, ... );
|
|
#if defined(_FILELOG_PACKET) || defined(_FILELOG_SPOS)
|
|
#define WriteLog( type, fmt, ... ) _WriteLog( type, fmt, __VA_ARGS__ );
|
|
#else
|
|
#define WriteLog( type, fmt, ... )
|
|
#endif
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
void ErrorMessage(const wchar_t* fmt, ...);
|
|
void FormatMessage(UINT type, const wchar_t* fmt, ...);
|
|
|
|
//#define USE_FONT_BOLD
|