找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 977|回复: 3

[求助]产生Error C2065: 'nCmdShow' : undeclared identifier。这是为什么

[复制链接]
发表于 2009-11-4 01:16:46 | 显示全部楼层 |阅读模式 IP:江苏扬州
拼写没有错误
如果是缺少库可能是哪个呀?
我的包含
#include <windows.h>
#include <stdlib.h>
#include <string.h>
定义了
BOOL InitWindows(HINSTANCE hInstance,int nCmdShow);
在WinMain里有
if(!InitWindows(hInstance,nCmdShow))
return FALSE;
Compiling...
4.cpp
D:\graduate\程序\p10\4.cpp(14) : error C2065: 'nCmdShow' : undeclared identifier
发表于 2009-11-4 01:16:47 | 显示全部楼层 IP:江苏扬州
这是全部的程序

麻烦懂的人给看看吧

#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
long WINAPI WndProc(HWND hWnd,UINT iMessage,UINT wParam,LONG lParam);
BOOL InitWindowsClass(HINSTANCE hInstance);
BOOL InitWindows(HINSTANCE hInstance,int nCmdShow);
HWND hWndMain;
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdshow)
{
MSG Message;
if(!InitWindowsClass(hInstance))
return FALSE;
if(!InitWindows(hInstance,nCmdShow))
return FALSE;
while(GetMessage(&Message,0,0,0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;
}
long WINAPI WndProc(HWND hWnd,UINT iMessage,UINT wParam,LONG lParam)
{
HDC hDC;
HBRUSH hBrush;
HPEN hPen;
PAINTSTRUCT PtStr;
switch(iMessage)
{
case WM_PAINT:
hDC=BeginPaint(hWnd,&PtStr);
SetMapMode(hDC,MM_ANISOTROPIC);
hPen=(HPEN)GetStockObject(BLACK_PEN);
hBrush=(HBRUSH)GetStockObject(DKGRAY_BRUSH);
SelectObject(hDC,hBrush);
SelectObject(hDC,hPen);
RoundRect(hDC,50,120,100,200,15,15);
hBrush=(HBRUSH)GetStockObject(LTGRAY_BRUSH);
SelectObject(hDC,hBrush);
Ellipse(hDC,150,50,200,150);
hBrush=(HBRUSH)GetStockObject(HOLLOW_BRUSH);
SelectObject(hDC,hBrush);
Pie(hDC,250,50,300,100,250,50,300,50);
EndPaint(hWnd,&PtStr);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}
}
BOOL InitWindows(HINSTANCE hInstance,int nCmdShow)
{
HWND hWnd;
hWnd=CreateWindow("WinFill",
"填充示例程序",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
0,
CW_USEDEFAULT,
0,
NULL,
NULL,
hInstance,
NULL);
if(!hWnd)
return FALSE;
hWndMain=hWnd;
ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
BOOL InitWindowsClass(HINSTANCE hInstance)
{
WNDCLASS WndClass;
WndClass.cbClsExtra=0;
WndClass.cbWndExtra=0;
WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
WndClass.hIcon=LoadIcon(NULL,"END");
WndClass.hInstance=hInstance;
WndClass.lpfnWndProc=WndProc;
WndClass.lpszClassName="WinFill";
WndClass.lpszMenuName=NULL;
WndClass.style=CS_HREDRAW|CS_VREDRAW;
return RegisterClass(&WndClass);
}
回复

使用道具 举报

发表于 2009-11-4 01:16:48 | 显示全部楼层 IP:江苏扬州
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdshow)
请注意大小写
回复

使用道具 举报

发表于 2009-11-4 01:16:48 | 显示全部楼层 IP:江苏扬州
谢谢
就是这个问题……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 01:31 , Processed in 0.170723 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表