16비트 CRC 알고리즘 코드
#define POLYNOMIAL 0x8005 #define CRC_TABLE_SIZE 256 #define RCV_BUF_SIZE 4 #define USE_CRC_TABLE #ifndef USE_CRC_TABLE static unsigned short crc_table[CRC_TABLE_SIZE]; #else static unsigned short crc_table[CRC_TABLE_SIZE] = { 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011, 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022, 0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x8..
2009. 8. 19.
그래픽 출력 (그림그리기)
그래픽 출력 COLORREF SetPixel(hdc, nXPos, nYPos, clrref) DWORD MoveToEx(hdc, x, y, lpPoint) BOOL LineTo(hdc, xEnd, yEnd) BOOL Rectangle(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect) BOOL Ellipse(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect) 보다시피 모든 GDI 함수의 첫번째 인수는 DC 핸들인 hdc이므로 TextOut 함수와 마찬가지로 DC핸들부터 얻어야 그래픽을 출력할 수 있다. DC의 개념만 알고 있다면 함수의 이름 자체가 아주 설명적이거나 도스와 동일하므로 직관적으로 이해할 수 있을 것이다. 우선 S..
2008. 11. 26.