// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#define _EXECUTE_CODE_ANALISIS
#ifdef	_EXECUTE_CODE_ANALISIS
#pragma warning(disable: 6284)
#pragma warning(disable: 6011)
#pragma warning(disable: 6387)
#endif

#if !defined(AFX_STDAFX_H__85B1B8E1_6B1D_49B8_A5A4_E01D9BA26A27__INCLUDED_)
#define AFX_STDAFX_H__85B1B8E1_6B1D_49B8_A5A4_E01D9BA26A27__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#if _MSC_VER >= 1400

#define _CRT_SECURE_NO_DEPRECATE
#define APL_REPORTMGR_IMPL


#ifndef WINVER
#define WINVER 0x0502
#endif

#endif

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions

#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

//#include "apl_api.h"
#include <locale.h>
#include <aplguiex.h>
#include <apl_gui.h>
#include <aplStepDataWithFile.h>
#include <aplNetStepData.h>
#include <apl_image.h>
#include "ReportDict.h"
#include "ReportView.h"

#define TREE_VIEW_CONTEXT_MENU 0
#define DELETE_OBJECT(val) try{delete val;}catch(...){ CString __sTraceMsg; __sTraceMsg.Format(APL_T("Ошибка удаления переменной %s(%d)"), __FILE__, __LINE__); TRACE(__sTraceMsg);}

enum { NONE_ACT, LINE_CREATE_ACT , RECT_CREATE_ACT, FIELD_CREATE_ACT, TABLE_CREATE_ACT, PARAM_CREATE_ACT, SHOW_PROPER_ACT, ZOOM_ACT, MOVE_ACT, CREATE_TABLE_MAP_ACT,
	PASTE_ACT};

#ifndef PAGE_OFFSET 
#define PAGE_OFFSET 30

#define AFX_NO_DATA APL_T("Не задано значение m_data")
#define AFX_NO_DICT APL_T("Не задано значение m_dict")

#include <AFXTEMPL.H>

class CReportElement;
typedef CArray <CReportElement*, CReportElement*>  RE_Array;

#endif

extern HINSTANCE dllInst;
extern int cd_count;
extern CImageList *m_ImageList;
extern CDC		*_pPrinterDC;


bool GetExePath(CString &buf);

#define _TEST_VERSION
#ifndef _TEST_VERSION
#define TRACE_TO_FILE(error_string)
#else
#define TTF_FileName _T("report.log")
#define CREATE_LOG_FILE CString buf;\
						GetExePath(buf);\
						if(file.Open(buf+TTF_FileName,CFile::modeCreate))\
							file.Close();
#define TRACE_TO_FILE(error_string)	{\
	CString debug_message;\
	debug_message.Format(_T("%s(%i) : {%i} %s : %s\n"), __FILE__, __LINE__, 0, _T("Warning"), error_string);\
	OutputDebugString(debug_message);\
	CStdioFile file;\
	CString ttf_buf; COleDateTime time = COleDateTime::GetCurrentTime();\
	GetExePath(ttf_buf);\
	if(file.Open(ttf_buf+TTF_FileName,CFile::modeWrite))\
		{file.SeekToEnd(); file.WriteString(time.Format(_T("%d.%m.%Y %H:%M:%S  "))); file.WriteString(debug_message);file.Close();}\
	else if(file.Open(ttf_buf+TTF_FileName,CFile::modeCreate|CFile::modeWrite))\
		{file.SeekToEnd(); file.WriteString(time.Format(_T("%d.%m.%Y %H:%M:%S  "))); file.WriteString(debug_message);file.Close();}}

#endif


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__85B1B8E1_6B1D_49B8_A5A4_E01D9BA26A27__INCLUDED_)
