#include <windows.h>

#ifndef AfxErrMsg
// 에러 문자열 출력.
void PutErrString(char *str, char * fileName, unsigned int lineNum)
{
	char buf[256];
	wsprintf(buf, "error : %s (%d) - %s\n", fileName, lineNum, str);
	OutputDebugString(buf);
}

// 에러 메세지 출력. 뭐.. 스타일은 알아서 정하기.
void PutErrMsg(char * str, char * fileName, unsigned int lineNum)
{
	PutErrString(str, fileName, lineNum);
}


void SendLogMessage(HWND hwnd, LPSTR fmt, ...)
{
	char buff[256];
	int iIndex;
	wvsprintf(buff, fmt, (LPSTR)(&fmt+1));
	iIndex=SendMessage(hwnd, LB_ADDSTRING, 0, (LONG) (LPSTR) buff);
	SendMessage(hwnd, LB_SETCURSEL, iIndex, 0);
}

#define AfxErrMsg(str)	{	PutErrString(str, __FILE__, __LINE__);	}
#endif



