第一个VC++程序注意的问题

1. VS2005 项目属性-->配置属性-->C/C++-->常规-->检测64位可移植性问题-->否

2.

问题: 无法从“const char [10]”转换为“LPCWSTR”

解决: VS2005 项目属性-->配置属性-->常规-->字符集-->未设置

原因: LPWSTR MSDN解释  W= Unicode character string

For example, to convert from a Unicode string to a generic string without changing the converted string, use CW2CT.

If it is known that the converted string is unlikely to be more than 64 characters, the EX version, such as CW2CTEX<64>, can be used to save space on the stack.

3.

问题:“WinMain”: 无法重载函数

解决:

int WINAPI WinMain(
  HINSTANCE hInstance,
  HINSTANCE hPrevInstance,
  LPSTR lpCmdLine,
  int nShowCmd
)

4. 如果下面2个标红的窗口类名不一样, 运行时不会报错, 但是窗口显示不出来

wndcls.lpszClassName = "ferry2010";

hwnd = CreateWindow("ferry2010", "渡口网络", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 600, 400, NULL, NULL, hInstance, NULL);

5. while(GetMessage(&msg, NULL, 0, 0))   NULL 表示获取所有窗口的消息

 

转载于:https://www.cnblogs.com/jackeyalg/archive/2010/07/16/1778673.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值