Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 문자열
- winsock
- 셋업
- 인스톨
- xml
- 초보
- dll
- c#
- MySQL
- 예제
- MFC
- Visual Studio 2005
- 설치
- 데이터베이스
- Firebird
- SDK
- 시리얼 통신
- 델파이
- 파라미터
- 소니
- 기초
- Delphi
- 입문
- VB.NET
- Visual Basic
- vb
- 파이어버드
- WIN32 SDK
- SQL
- PostgreSQL
Archives
- Today
- Total
프로그래밍 노트
Variable prefixes 변수명에 붙이는 접두사 관련 스크랩 본문
접두사
변수 또는 객체
i 정수형 첨자(Integer 또는 Long 형식) h 핸들 ord ordinal(a numeric identification code used when the specific value is unimportant except to distinguish the variable from others) x, y 점의 x, y 좌표 dx, dy x와 y좌표에 의한 델타(혹은 거리) (dx 는 너비, dy 는 높이) f Boolean af 비트 플래그(비트에 의해 표현되는 Boolean 배열) r 실수(Single 또는 Double 형) b Byte 형 v Variant 형 cur 통화(Currency 형) time 시간(time) date 날짜(Date) dt 시간과 날짜 혼합(Date and time combined) s 문자열(String 형) p 포인터(API 함수에서 Long 변수) cmd 단추(Button) chk 체크 상자(Check Box) txt 텍스트 상자(Text Box) pb 그림 상자(Picture Box) pic picture 개체 lst 목록 상자(List Box) cbo 콤보 상자(combo box) lbl 레이블(label) mnu 메뉴(menu) tmr 타이머(timer) opt 옵션 단추(option button. 혹은 라디오 단추(radio button)) c 카운트 A 배열 N 컬렉션
Prefix Type Description Example
ch char 8-bit character chGrade
ch TCHAR 16-bit character if _UNICODE is defined chName
b BOOL Boolean value bEnabled
n int Integer (size dependent on operating system) nLength
n UINT Unsigned value (size dependent on operating system) nLength
w WORD 16-bit unsigned value wPos
l LONG 32-bit signed integer lOffset
dw DWORD 32-bit unsigned integer dwRange
p * Pointer pDoc
lp FAR* Far pointer lpDoc
lpsz LPSTR 32-bit pointer to character string lpszName
lpsz LPCSTR 32-bit pointer to constant character string lpszName
lpsz LPCTSTR 32-bit pointer to constant character string if _UNICODE is defined lpszName
h handle Handle to Windows object hWnd
lpfn callback Far pointer to CALLBACK function lpfnAbort
b or f—used as a prefix for booleans (f stands for flag).
c—used as a prefix to chars.1
n—used as a prefix to shorts.
h—used as a prefix for a handle. Handles in Win32 are numbers used to identify resources or
windows. They are not pointers or pointers to pointers. Think of them as ID numbers.
l—used as a prefix to a long.
w—used as a prefix to a word.
dw—used as a prefix to a double word.
s—used as a prefix to a string.
sz—used as a prefix to a null-terminated string.2
p—used as a prefix to a pointer.
lp—used as a prefix to a long pointer (this is the same as a pointer in Win32 and is a relic
from Win16).
fn—used as a prefix to function parameters.
m_—all member variables are preceded with an m_.
On—all message handlers function should be preceded with On (e.g., OnSize). Note
however, that not all functions that begin with On are true Win32 message handlers. For
example OnInitialUpdate is not a Win32 message handler, and there is no corresponding
WM_INITIALUPDATE Windows message.
Comments