visual Studio 2015 编写WIN32 提示 LNK1309错误

KDHJA4593 2016-11-24 10:14:03
#include<Windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT("hellowin");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;//创建窗口
visual Studio 2015
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;//句柄
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);//图标
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);//鼠标图片
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);//背景颜色
wndclass.lpszMenuName = NULL;//指定窗口菜单
wndclass.lpszClassName = szAppName;//窗口类名

if (!RegisterClass(&wndclass))//注册窗口
{
MessageBox(NULL, TEXT("this "), szAppName, MB_ICONERROR);
}
hwnd = CreateWindow(szAppName, TEXT("第一窗口程序"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);//创建窗口
ShowWindow(hwnd, iCmdShow);//显示窗口
UpdateWindow(hwnd);

while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;

switch (message)
{
case WM_CREATE:
PlaySound(TEXT("HELLOWIN.WAV"), NULL, SND_FILENAME | SND_ASYNC);
return 0;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
DrawText(hdc, TEXT("hello windows 98"), -1,&rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);

EndPaint(hwnd, &ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
不知道这个是那里写错了 在百度查了好久也没弄明白 求大牛指教
...全文
997 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hanford 2016-11-27
  • 打赏
  • 举报
回复
不要使用clr库

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧