在vs2005以前版本的vs默认使用多字节字符集,而vs2005默认使用unicode字符集,这会使一些代码不能编译通过
其区别如下
unicode字符集
void Point::output(int x, int y)

...{
HWND hwnd=GetForegroundWindow();
HDC hdc=GetDC(hwnd);
TCHAR buf[20];
memset(buf,0,20);
int length;
length=wsprintf(buf,TEXT("x=%d,y=%d"),x,y);
TextOut(hdc,0,0,buf,length);
ReleaseDC(hwnd,hdc);
}
多字节字符集
void Point::output(int x, int y)

...{
HWND hwnd=GetForegroundWindow();
HDC hdc=GetDC(hwnd);
char buf[20];
memset(buf,0,20);
wsprintf(buf,x=%d,y=%d",x,y);
TextOut(hdc,0,0,buf,strlen(buf));
ReleaseDC(hwnd,hdc);
}