# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://ftp.daum.net/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.daum.net/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://ftp.daum.net/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://ftp.daum.net/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://ftp.daum.net/centos/RPM-GPG-KEY-CentOS-5

Posted by 꿍's
,

자신이 수행하는 루틴의 성능을 측정하는 방법으로 그 루틴이 수행된 시간을 획득 하는 방법이 있다.
Windows에서는 여러가지 시간측정 방법을 제시하는데, 여기서는 QueryPerformanceCounter를 알아보겠다.


QueryPerformanceCounter : 고성능의 카운터이다. LONGLONG 형의 64bit 인자를 가지며, 가장 낮은 단위의 시간측정을 지원한다. 하지만 일부 최신의 시스템(CPU 클럭이 2G이상이거나, AMD사의 듀얼 코어 이상의 제품)에서는 잘못된 값을 전달하기때문에 문제가 발생 할 수 있다.

사용방법

#include 

static LARGE_INTEGER initial;
static LARGE_INTEGER freq;
void Start()
{
    QueryPerformanceCounter(&initial);
}

void Performance()
{
    LARGE_INTEGER counter;
    double StartQuerytime;
    double EndQuerytime;
    QueryPerformanceCounter(&counter);
    QueryPerformanceFrequency(&freq);
 

    StartQuerytime = ((double)(counter.QuadPart-initial.QuadPart)) / ((double)freq.QuadPart);
    측정함수();
    QueryPerformanceCounter(&counter);
    QueryPerformanceFrequency(&freq);
    EndQuerytime = ((double)(counter.QuadPart-initial.QuadPart)) / ((double)freq.QuadPart);
    printf("%d", (unsigned int)((EndQuerytime-StartQuerytime)*1000));
} 

 

Posted by 꿍's
,

Dialog가 종료되는 상황
  1. IDOK 버튼을 눌렀을 때
    • OnOK() 호출 뒤 OnDestroy() 호출됨
  2. IDCANCEL 버튼을 눌렀을 때
    • OnCancel() 호출 뒤 OnDestroy() 호출됨
  3. Dialog의 우측 상단 종료 버튼(x)를 눌렀을 때
    • OnClose() 호출 뒤 OnCancel() 마지막으로 OnDestroy() 호출됨
  4. Esc 버튼을 눌러 종료할 때 - 결과만 놓고 봤을 때 'Esc = IDCANCEL' 이 된다는 말인가?? 아무튼 결과는 동일
    • OnCancel() 호출 뒤 OnDestroy() 호출됨
  5. Alt + F4 로 종료할 때
    • OnClose() 호출 뒤 OnCancel() 마지막으로 OnDestroy() 호출됨
Posted by 꿍's
,

CTime 클래스는 시간 정보를 손쉽게 제공해주는 클래스이며, CTimeSpan클래스는 시간 연산을 위해 제공되는 클래스이다.
CTime 객체의 +,-연산의 피연산자는 CTimeSpan을 이용해야 한다.

CTime t1 = CTime::GetCurrnetTime();             // 시스템 현재 시간
CTimeSpan t2(10000);                                   // 10000 초만큼 시간 저장
CTimeSpan t3();

CString Time;

t3 = t1 - t2;

Time = t3.format("%H%M%S");
Posted by 꿍's
,

VS2005에서 멀티바이트처리를 위해서 사용한다.

WideChar 를 Ansi 형태 혹은 Ansi Char Set을 Wide char Set 으로 아주 간편하게 바꿔주는 매크로

USER_CONVRSION을 사용하기 위해서는

1. ATL Project
 -> 바로 사용 가능하다

2. MFC Project
 #include <comdef.h>
 #include <afxpriv.h> 를 추가한다.

3. Win32 Dll Project
#include <comdef.h>
#include <CRTDBG.H>
#include <atlconv.h> 를 추가한다.

그리고 소스에서 추가한다.
USES_CONVERSION;

A2CW (LPCSTR) -> (LPCWSTR)
A2W (LPCSTR) -> (LPWSTR)
W2CA (LPCWSTR) -> (LPCSTR)
W2A (LPCWSTR) -> (LPSTR)

T2COLE (LPCTSTR) -> (LPCOLESTR)
T2OLE (LPCTSTR) -> (LPOLESTR)
OLE2CT (LPCOLESTR) -> (LPCTSTR)
OLE2T (LPCOLESTR) -> (LPCSTR)
Posted by 꿍's
,


Windows Programming에서 char* 대신 사용하기 위해 사용되는 자료형

LP : long poniter
    LP는 .net이상의 컴파일러에서는 64bit poniter, VC++6.0 이하의 컴파일러에서는 32bit pointer를 나타낸다.
C : constant
    상수 문자열
STR : string
    말그대로 문자열이라는 뜻, 내부적인의미로 char형 배열에 null값 종료를 뜻함
W : wide char
    Unicode를 사용하는 문자열
T : t_char
    multi-byte와 Unicode 사용하는 시스템에따라 알맞게 변환하는 매크로


LPSTR = long pointer string = char *
LPCSTR = long pointer constant string = const char *
LPWSTR = long pointer wide string = w_char *
LPCWSTR = long pointer constant wide string = const w_char *
LPTSTR = long pointer t_char string = 멀티바이트시스템의 경우 char *, 유니코드시스템일 경우 w_char *
LPTCSTR = long pointer constant t_char string = 멀티바이트시스템의 경우 const char *, 유니코드시스템일 경우 const w_char *



Posted by 꿍's
,

Friend 란 형식을 C++에서, Private 함수 및 변수 등을 특정 클래스에 노출시키기 위해 사용한다.

Friend Function :
Friend Function은 동시에 여러 클래스의 Private 변수를 접근 하기 위해 사용된다.

Friend Class :
Friend Class는 클래스내에서 특정 클래스를 Friend Class로 지정하면 지정된 Class의 Private 멤버에 접근이 가능하도록 하기 위해 사용한다.
Posted by 꿍's
,

신화선씨 저자의 DirectShow 멀티미디어 프로그래밍에 보면 JIF와 LIF 매크로에 대한 설명이 있다.

책에서 제공하는 Wizard의 Auxiliary.h 헤더 파일에서 정의된 소스이다.
HRESULT hr;

//JIF(Jump - If- Failed) 
#define JIF(x) { if (FAILED(hr=(x))) \
 { TRACE(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return hr; }}

//LIF(Log-If-Failed) 
#define LIF(x) { if (FAILED(hr=(x))) \
 { TRACE(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); }}

//Form Auxiliary.h
오류가 발생했을 경우, 그 내용을 디버깅창에 띄워주는 역활을 한다.
Posted by 꿍's
,
* 헝가리안 표기법 *
c      char
by     byte
n      short
i      int
x, y   x축이나 y축으로 사용되는 정수
cx,cy  x나 y길이로 사용되는 정수(c는 count)
b      BOOL
f      FLOAT
w      WORD
l      LONG
dw     dword(unsigned short)
fn     function
s      string
sz     Null로 종료되는 문자열(string)
h      handle
p      pointer

CS - 클래스 스타일 옵션
CW - 윈도우 생성 옵션
DT - 문자열 그리기 옵션
MB - 메시지 박스
SND - 사운드 옵션
WM - 윈도우 메시지
WS - 윈도우 스타일

MSG - 메시지 구조체
WNDCLASS - 윈도우 클래스 구조체
PAINTSTRUCT - Paint 구조체
RECT - 사각형 구조체

HINSTANCE - 프로그램 인스턴스에 대한 핸들
HWND - 윈도우에 대한 핸들
HDC - DeviceContext(장치 컨텍스트)에 대한 핸들

ID - 메뉴 아이템에 대한 ID
IDI - 아이콘에 대한 ID
IDC - 커서에 대한 ID 숫자
IDD - 다이얼로그에 대한 ID
IDR - 엑셀레이터에 대한 ID
IDB - 비트맵에 대한 ID

Posted by 꿍's
,