亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stlogfile.h

?? windows ce開發技巧與實例光盤代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
/////////////////////////////////////////////////////////////////////////////
// File name:      STLogFile.h
// Author:         Nicholas Tsipanov (nicholas@spbteam.com)
// Created:        March 2001
// Last changed:   September, 04, 2002
// Version:        3.2
// Description:    Debug tracing to file 
//
//
/////////////////////////////////////////////////////////////////////////////
// LICENSE
// 
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included.
//
// This code can be compiled, modified and distributed freely, providing
// that this copyright information remains intact in the distribution.
//
// This code may be compiled in original or modified form in any private 
// or commercial application.
//
// THIS CODE IS DISTRIBUTED "AS IS".  NO WARRANTY OF ANY
// KIND IS EXPRESSED OR IMPLIED.  YOU USE AT YOUR OWN RISK.
// THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS
// OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING
// THIS SOFTWARE.

#ifndef ___LOGFILE_H__INCLUDED___
#define ___LOGFILE_H__INCLUDED___

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

#include <wtypes.h>
//  Comment the line below if you don't want logging
#define STLOG_DEBUG 1

//  If STLOG_CREATE_NEW is defined then every time your program starts it will create 
//  a new log file named <Executable>00.log, <Executable>01_log.txt, etc. Otherwise it will 
//  overwrite the old <Executable>_log.txt file.
//#define STLOG_CREATE_NEW 1

//Every time the program starts the program will delete the previous file if it uses the 
// single log (sometime it is not needed, for example you want to have all logs of all program runs)
#define STLOG_DELETE_OLD

//  By default the logfile is created in the root folder, but you 
// may want to create a log in the directory where the executable is located
//#define STLOG_CREATE_FILE_IN_THE_SAME_DIRECTORY

//  Undef this if you don't want compile time info (file name and line number 
//  where the logging has been called) included in the log
//#define STLOG_PRINT_COMPILE_INFO 1

//override standard TRACE macro behaviour
#define STLOG_USE_FOR_TRACE

//You can specify your log file name if you want to. In most cases 
// it can be done automatically : Logfile determines where the executable is located
// and creates an <executable>_log.txt file, but if you want a custom file, then 
//unocomment the #define below and somewhere in you .cpp files (stdafx.cpp most appropriate)
// add the line  LPCTSTR cszLogFileName = _T("C:\\LogFile");
//#define STLOG_FILENAME extern LPCTSTR cszLogFileName;


#define STLOG_MAXCOUNTERS 30

/*USAGE::
#include this file into any header that will be included in all files.
For VC projects using precompiled headers the ideal place would be stdafx.h
You can either insert this file into the project or not, in the latter case 
the log classes won't litter your project workspace. This won't affect
usage of logs.

The primary usage of this code is to have a simple way to output debugging
information into the log file, which could be easiliy turned off or on during 
the compile time.
Example :

STLOG_WRITE(_T("saving %d transactions"), nTransactions); 

Another STLogFile feature, marker: 

void MyFunction()
{
	STLOG_MARKER(_T("MyFunction"));
	if (somethingbad())
		return FALSE;
	if (somethinggood())
		return TRUE;

	return FALSE; 
}

If you want to output some binary data (buffer contents) you should use a STLOG_WRITE_DATA macro:

  {
  ...
  char buffer[125];
  // .. fill the buffer with data 

  STLOG_WRITE_DATA(buffer, 125);
  }

This code will write a >>[MyFunction] line on entering the function and <<[MyFunction] 
on exit wherever the program leaves your function.

To find out the problem of the wrong function execution simply add STLOG_LASTERROR:

  HANDLE hFile = CreateFile(....);
  if (INVALID_HANDLE == hFile)
  {
	STLOG_WRITE("Cannot open file");
	STLOG_LASTERROR;
  }
This will print the last textual description of error returned by GetLastError() funciton.

And .. profiling. Before describing log file profiling features it would be appropriate 
to say that all measured timing includes the time for file operation, which slightly 
increases the execution time, therefore this method could only help to *estimate* and 
compare execution times to find bottlenecks of your code.


  ....
  STLOG_PROFILE_FUNCTION(Calculate());
  ..
This code will estimate time needed for function execution. Simple. When the 
logging is turned off this will be transformed to straight call to Calculate().


  {
	STLOG_PROFILE_BLOCK;
	.. code here ...

  }
  This sample of code will print to log file the time when the execution entered the
  profiled block, when the execution leaves it and the time interval between the two points.
  When your program finishes, this macro will print profiling statistics, like how many 
  times this code has been executed, how much time did it take in total, in average, 
  maximium and minimum timings.


  Sometime you want to have intermediate timings and STLogFile has a solution for this case:
  {
	STLOG_PROFILE_BLOCK;
	Phase0();
	STLOG_PROFILE_CHECKPOINT
	Phase1();
	STLOG_PROFILE_CHECKPOINT
	Phase2();
  }
  This will print timings between the check points and the time from beginning of the block 
  every time execution reaches any check point.

There are some options, which can be used for fine tuning like where to create log file,
how to create it and others. 




*/

//---------------  Don't touch anything below this line. 
//---------------  Of all changes and improvements please notify authors via email. 

#ifdef STLOG_DEBUG

	#ifdef STLOG_PRINT_COMPILE_INFO
		static CHAR *CURRENT_FILE;
		static DWORD CURRENT_LINE;
	#endif

	#ifdef STLOG_FILENAME
		STLOG_FILENAME;
	#endif
	static int ___g_nCounterIndex___ = 0;
	class CSTLogFile  
	{
	public:
		static CSTLogFile *GetLogFile() 
		{
			static CSTLogFile LogFile;
			if (!LogFile.m_bIsStarted) 
				LogFile.Start();
			return &LogFile;
		}

		inline void Write0(LPCSTR szEntry)
		{
			::EnterCriticalSection(&m_crit);
			BOOL bOk = TRUE;
			char szTimeString[200];
			bOk = GetTimeString(szTimeString, sizeof(szTimeString));
			char buffer[1024];
#ifdef STLOG_PRINT_COMPILE_INFO
			int nBytes = _snprintf(buffer, sizeof(buffer), "%s : %s\t(from %s,%d)\r\n", szTimeString, szEntry, CURRENT_FILE, CURRENT_LINE);
#else
			int nBytes = _snprintf(buffer, sizeof(buffer), "%s : %s\r\n", szTimeString, szEntry);
#endif
			bOk = (nBytes > 0);
			if (!bOk) goto exit_function;
			DWORD dwWrittenBytes;
			::SetFilePointer(m_hFile, 0, 0, FILE_END);
			::WriteFile(m_hFile, buffer, nBytes, &dwWrittenBytes, NULL);
			bOk = (dwWrittenBytes != (DWORD)nBytes);
			if (!bOk) goto exit_function;
			::FlushFileBuffers(m_hFile);
		exit_function:
			::LeaveCriticalSection(&m_crit);
		}

		void WriteData(LPCVOID pBytes, DWORD dwSize) 
		{
			Write("***Binary data (%d bytes)",  dwSize);
			DWORD dwWrittenBytes;
			::SetFilePointer(m_hFile, 0, 0, FILE_END);
			::WriteFile(m_hFile, pBytes, dwSize, &dwWrittenBytes, NULL);
			::WriteFile(m_hFile, "\r\n", 2, &dwWrittenBytes, NULL);
			Write("***End binary data");
		}
		void Write(LPCSTR szEntry, ...)
		{
			BOOL bOk = TRUE;
			if (m_bIsStarted) 
			{
				char buffer[1024];
				va_list args;
				va_start(args, szEntry);
				bOk = (-1 != _vsnprintf(buffer, sizeof(buffer), szEntry, args));
				va_end(args);
				if (!bOk) return;
				Write0(buffer);
			}
		}

		void Write(LPCWSTR szEntry, ...) 
		{
			BOOL bOk = TRUE;
			if (m_bIsStarted) 
			{
				WCHAR buffer[1024];
				va_list args;
				va_start(args, szEntry);
				int nSize = _vsnwprintf(buffer, sizeof(buffer) / sizeof(WCHAR), szEntry, args);
				bOk = (-1 != nSize);
				va_end(args);
				if (!bOk) return;
				char *pAnsiString = new char[nSize+1];
				wcstombs(pAnsiString, buffer, nSize+1);
				Write0(pAnsiString);
				delete pAnsiString;
			}
		}

		void WriteGUID(REFGUID rguid)
		{
			OLECHAR szBuffer[40];
			StringFromGUID2(rguid, szBuffer, 40);
			Write(_T("GUID: %s"), szBuffer);

		}

		void WriteCLSID(REFCLSID rclsid)
		{
			LPOLESTR lpszBuffer;
			StringFromCLSID(rclsid, &lpszBuffer);
			Write(_T("CLSID: %s"), lpszBuffer);
			CoTaskMemFree(lpszBuffer);
		}

		void WriteIID(REFIID  rclsid)
		{
			LPOLESTR lpszBuffer;
			StringFromIID(rclsid, &lpszBuffer);
			Write(_T("CLSID: %s"), lpszBuffer);
			CoTaskMemFree(lpszBuffer);
		}

		void WriteLastError() 
		{ 
			DWORD dwError = GetLastError(); 
			LPVOID lpMsgBuf;                 
			if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
				NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL ))
			{
				Write(_T("GetLastError returned : %d (no further information)"), dwError);
			} else {
				TCHAR *ret;
				while (ret = _tcsrchr((LPTSTR)lpMsgBuf, _T('\n'))) *ret = _T(' ');
				while (ret = _tcsrchr((LPTSTR)lpMsgBuf, _T('\r'))) *ret = _T(' ');
				CSTLogFile::GetLogFile()->Write(_T("GetLastError returned : 0x%08x: %s)"), dwError, lpMsgBuf);
				LocalFree( lpMsgBuf ); 
			}
		}


		void Start() 
		{
#ifdef STLOG_FILENAME
			Start(cszLogFileName);
#else
			TCHAR wszFileName[MAX_PATH];
			GetLogFileName(wszFileName);
			Start(wszFileName);
#endif
		}

		void Start(LPCTSTR szFilePath) 
		{
			if (m_bIsStarted) return;
			::EnterCriticalSection(&m_crit);
#ifdef STLOG_DELETE_OLD
			::DeleteFile(szFilePath);
#endif
			m_hFile = ::CreateFile(szFilePath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 
							OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
			HRESULT hr = GetLastError();
			if (m_hFile != INVALID_HANDLE_VALUE)
			{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费毛片a| 国产麻豆精品在线| 国产白丝精品91爽爽久久| 欧美三片在线视频观看 | 精品一区二区日韩| 色婷婷久久一区二区三区麻豆| 精品国产一区二区精华| 一区二区久久久久久| 成人av动漫在线| 日韩欧美黄色影院| 亚洲一区二区三区视频在线播放 | 美美哒免费高清在线观看视频一区二区| 成人美女在线观看| 精品久久久久久最新网址| 亚洲午夜在线视频| 97精品国产露脸对白| 国产色91在线| 美女精品自拍一二三四| 欧美日韩国产色站一区二区三区| 亚洲视频一区二区免费在线观看| 国产精品资源在线| 日韩欧美电影在线| 日韩主播视频在线| 欧美亚洲综合在线| 亚洲人成电影网站色mp4| 国产999精品久久久久久绿帽| 亚洲精品一区二区三区99| 天天色综合天天| 欧美日韩在线一区二区| 伊人一区二区三区| 91丨九色丨蝌蚪丨老版| 国产精品久久久久影视| 国产91丝袜在线观看| 26uuuu精品一区二区| 日韩精品一二三| 欧美高清视频一二三区| 亚洲电影在线免费观看| 在线一区二区视频| 又紧又大又爽精品一区二区| 91久久线看在观草草青青| 亚洲蜜桃精久久久久久久| 99re这里都是精品| 亚洲黄网站在线观看| 在线观看日产精品| 亚洲五码中文字幕| 欧美日韩视频不卡| 天天操天天干天天综合网| 欧美日韩大陆一区二区| 日韩主播视频在线| 日韩欧美亚洲国产另类| 国内一区二区在线| 久久久国产一区二区三区四区小说 | 欧美日韩高清一区二区| 亚洲午夜av在线| 欧美日韩成人一区| 日本不卡一区二区三区高清视频| 91精品在线一区二区| 美国十次综合导航| 久久综合狠狠综合| 成人少妇影院yyyy| 亚洲欧美视频一区| 欧美视频日韩视频在线观看| 五月天网站亚洲| 日韩精品资源二区在线| 国产成人丝袜美腿| 中文字幕亚洲成人| 在线观看av一区二区| 丝袜a∨在线一区二区三区不卡| 欧美一区二区免费观在线| 久久国产精品无码网站| 国产欧美日韩另类一区| 色综合久久88色综合天天| 五月天激情综合| 欧美成人性福生活免费看| 国产成人午夜精品影院观看视频 | 日本一区二区三区在线不卡| 不卡高清视频专区| 亚洲一区二区视频| 日韩三级视频中文字幕| 国产精品1区2区| 亚洲人成影院在线观看| 欧美剧在线免费观看网站| 国内欧美视频一区二区 | 91精品国产综合久久精品app | 捆绑变态av一区二区三区| 国产日韩欧美综合一区| 色天天综合久久久久综合片| 奇米精品一区二区三区在线观看| 国产午夜三级一区二区三| 色94色欧美sute亚洲线路二| 日本一区中文字幕| 国产精品午夜免费| 欧美日韩精品高清| 国产美女精品人人做人人爽| 亚洲欧美国产77777| 欧美一区二区三区人| 成人丝袜高跟foot| 视频精品一区二区| 一色桃子久久精品亚洲| 91麻豆精品国产91久久久更新时间 | 一区二区三区欧美| 2023国产精品视频| 在线国产亚洲欧美| 国产一区二区三区免费播放| 亚洲精品国产无套在线观| 欧美www视频| 欧美艳星brazzers| 高清在线观看日韩| 日韩精品亚洲专区| 亚洲欧美日本韩国| 精品国产乱码久久久久久老虎| 色噜噜狠狠成人网p站| 国产一区激情在线| 性感美女久久精品| 国产精品美女久久久久aⅴ国产馆| 欧美精品aⅴ在线视频| 成人精品国产免费网站| 久久精品国产亚洲aⅴ | 精品国产乱码久久| 欧美视频在线不卡| 成人国产精品免费观看动漫| 麻豆一区二区三| 一区二区三区不卡在线观看| 国产亚洲欧美日韩俺去了| 在线成人免费观看| 91在线免费视频观看| 国产一区91精品张津瑜| 丝袜亚洲另类丝袜在线| 亚洲精品亚洲人成人网| 国产三级久久久| 亚洲精品一区二区精华| 91精品国产综合久久福利| 色激情天天射综合网| 处破女av一区二区| 国内精品视频666| 美女视频一区二区| 日韩精品每日更新| 亚洲丰满少妇videoshd| 亚洲女爱视频在线| 中文字幕亚洲一区二区av在线| 久久亚洲影视婷婷| 欧美成人欧美edvon| 欧美理论电影在线| 欧美午夜精品一区| 日本高清成人免费播放| 成人av午夜影院| 岛国一区二区三区| 国产成人鲁色资源国产91色综| 韩国三级在线一区| 极品少妇一区二区三区精品视频 | 国产精品美女www爽爽爽| 国产免费成人在线视频| 久久久久国产精品麻豆ai换脸| 26uuu成人网一区二区三区| 欧美精品一区二区不卡 | 在线观看一区二区视频| 日本道免费精品一区二区三区| 色婷婷综合久久久中文字幕| 91亚洲精品乱码久久久久久蜜桃| 成人动漫一区二区在线| aaa欧美色吧激情视频| av午夜一区麻豆| 97se亚洲国产综合在线| 99re成人在线| 色综合激情久久| 欧美午夜精品一区二区蜜桃| 欧美日韩国产在线播放网站| 欧美疯狂性受xxxxx喷水图片| 7777精品伊人久久久大香线蕉最新版| 欧美性xxxxx极品少妇| 欧美久久久久免费| 欧美一区二区三区免费大片| 日韩欧美国产三级| 久久先锋影音av鲁色资源网| 久久久精品天堂| 1024国产精品| 亚洲在线成人精品| 天堂在线一区二区| 久久99精品网久久| 成人一区二区三区| 91在线视频观看| 欧美日韩夫妻久久| 欧美v国产在线一区二区三区| 久久婷婷成人综合色| 亚洲国产成人一区二区三区| 日韩伦理免费电影| 亚洲国产欧美日韩另类综合 | 亚洲人成精品久久久久久| 亚洲国产日韩一区二区| 全部av―极品视觉盛宴亚洲| 国产伦理精品不卡| 91视频在线观看| 欧美精品丝袜中出| 久久综合久久99| ...中文天堂在线一区| 亚洲成人久久影院| 久久 天天综合| 成人美女在线观看| 欧美裸体一区二区三区| 久久久www成人免费毛片麻豆|