IT 취미생활.  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
파일명, 라인정보를 보여주는 에러 메세지 박스 만들기
 #define 스크립트를 이용하면 쉽게 파일명과 줄번호가 출력되는 메세제 박스를
만들 수 있습니다..

아래 코드를 참조 하세요

코드:
#include <stdio.h>
#include <windows.h>
#include <stdarg.h>
void ShowMessage(const char* strFormat, ...)
{
static char strBuff[512];
va_list args;
va_start(args, strFormat);
vsprintf(strBuff, strFormat, args);
va_end(args);
MessageBox(0, strBuff, "Message", MB_ICONERROR);
}





#define SHOW_ERROR(Msg) {

ShowMessage("%s(%d) %s \n", __FILE__, __LINE__, Msg );
}











#define CHEAK_ERROR(Flg)
{
if (!Flg)
ShowMessage("%s(%d) %d \n", __FILE__, __LINE__, Flg );
}



int main()
{
char* pSzString = NULL;
CHEAK_ERROR(pSzString);
if (s == NULL)
{
SHOW_ERROR(" Error NULL Pointer Here");
}
return 0;
}


*  개인적으로는 Debug Level에 따라서 출력이 되도록 수정하는 것도 좋을 것 같습니다
    또한 가변인자를 활용하여 여러가지의 값을 가지도록 만들어 보아요~!


BLOG main image
취미생활
 Notice
 Category
분류 전체보기 (191)
매일매일갱생 (83)
서버개발 (1)
임베디드개발 (12)
Programming (80)
Personal Projects (6)
유용한 프로그램 (0)
 TAGS
Error Case isdbt English Wince5.0 DVB 미라지폰 군대 DirectShow Debug It 티스토리 초대장 C++ 출장 MP3 project Linux VC++ 영어 이메일 DVB-T 개발자 Windows Mobile6.0 spam mail ISDB-T 서태지 Java M480 음식 퇴사 1seg 벨소리 변경 debugging Algorithm warning C english email 알고리즘 Brazil 티스토리초대 Dshow
 Calendar
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
 Recent Entries
 Recent Comments
 Recent Trackbacks
 Archive
 Link Site
zextor
괴짜 프로그래머의 일상사~@@
Gag & Peace, and more..
Kazakhstan Almaty.......
Min-A
Sadgarret
Steve Yoon's log
가슴 뛰는 삶을 살아라
오스틴 파워
GUI sin
melanie parker_Lady
제레미의 TV 2.0 이야기..
 Visitor Statistics
Total :
Today :
Yesterday :
rss