Windowsのデータ型まとめ:
LPCSTR(pointer const string??) => const CHAR *
LPCWSTR => const WCHAR *
CHAR => char
TCHAR => WCHAR => wchar_t -> Unicode
WORD => unsigned short
DWORD => unsigned long
Windowsのハンガリー記述法まとめ:
c char
by, b BYTE
n short, int
b,f BOOL(int)
w WORD or UINT
l LONG
dw DWORD
fn pointer to function
s string
sz ASCII string
p,lp pointer
Unicodeの文字はワイドCHARで,C言語ではこれ表すがたはwchar_t(2bytes)
C言語でwchar_tの使い方は:
#include
#include
int main(void)
{
wchar_t waidomoji[10] = L"漢字";//Lマクロに注意
setlocale(LC_ALL, "japanese");
wprintf(L"%s\n", waidomoji);
return 0;
}
WindowsではTEXT("...")マクロとTCHARを一緒に使うとUnicodeになる.
TEXT(quote) => __TEXT(quote) => Lquote
次の使い方もある
(LPCWSTR)L"Wide Char Message"
No comments:
Post a Comment