|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include<windows.h>
- #include<iostream>
- #include<string>
- using namespace std;
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- int res;
- int count=0;
- while (true)
- {
- res = MessageBox(NULL, TEXT("test window"), TEXT("是否关闭?"), MB_YESNO | MB_ICONINFORMATION);
- if (res == IDYES)
- count++;
- else
- break;
- }
- string out = "你总共点击了" + to_string(count) + "次";
- MessageBox(NULL, TEXT("end"), TEXT(out), MB_OK | MB_ICONINFORMATION);
- return 0;
- }
复制代码
为啥我运行上面的代码会报下面的错误:
- 未定义标识符 "Lout"
- “Lout”: 未声明的标识符
复制代码
(我使用VS)
必须得用 StringCchPrintf 来输出点击次数
|
|