Hi,
I simplified the program a bit~ 8^D
The compiler does things backwards sometimes. If this was a m68k
system it would have worked the first time.
Sorry,
James
// gcc -mconsole -mwindows gtfw.c -o gtfw.exe
//
// GetTextFaceW(hdc, 0, 00000000) -> 7,GetLastError() -> 1
// GetTextFaceW(hdc, 0, 0022FF52) -> 0,GetLastError() -> 87
// GetTextFaceW(hdc, -10000, 0022FF52) -> 0,GetLastError() -> 87
// GetTextFaceW(hdc, 1, 0022FF52) -> 1, GetLastError() -> 1
// GetTextFaceW(hdc, 1, 00000000) -> 7,GetLastError() -> 1
#include <windows.h>
#include <stdio.h>
int main()
{
HDC hdc = CreateCompatibleDC(NULL);
WCHAR buf[1];
int ret;
int c = 1;
LPWSTR lpName = buf;
SetLastError(1);
ret = GetTextFaceW(hdc, 0, NULL);
printf(("GetTextFaceW(hdc, %d, %p) -> %d,GetLastError() ->
%lu\n"), 0, NULL, ret, GetLastError());
SetLastError(1);
ret = GetTextFaceW(hdc, 0, lpName);
printf(("GetTextFaceW(hdc, %d, %p) -> %d,GetLastError() ->
%lu\n"), 0, lpName, ret,GetLastError());
SetLastError(1);
ret = GetTextFaceW(hdc, -10000, lpName);
printf(("GetTextFaceW(hdc, %d, %p) -> %d,GetLastError() ->
%lu\n"), -10000, lpName, ret,GetLastError());
SetLastError(1);
ret = GetTextFaceW(hdc, c, lpName);
printf(("GetTextFaceW(hdc, %d, %p) -> %d, GetLastError() ->
%lu\n"), c, lpName, ret,GetLastError());
SetLastError(1);
ret = GetTextFaceW(hdc, c, NULL);
printf(("GetTextFaceW(hdc, %d, %p) -> %d,GetLastError() ->
%lu\n"), c, NULL, ret,GetLastError());
}
// EOF