首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

Win32应用程序解决思路

2012-03-11 
Win32应用程序LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,WPARAM lParam)int WINAP

Win32应用程序
LRESULT CALLBACK WinSunProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
WPARAM lParam
);
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdshow
)
{
//设计一个窗口
WNDCLASS wndcls;
wndcls.cbClsExtra=0;
wndcls.cbWndExtra=0;
wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_CROSS);
wndcls.hIcon=LoadIcon(NULL,IDI_ERROR);
wndcls.hInstance=hInstance;
  wndcls.lpfnWndProc=WinSunProc;
  // 错误提示cannot convert from 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned int)' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)
wndcls.lpszClassName="sunxin2006";
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls);



[解决办法]
LPARAM lParam

[解决办法]
同上 回调函数最后一参数类型错误 LRESULT CALLBACK WinSunProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
[解决办法]
两个结构包含的元素不一样啊
[解决办法]
参数类型不一样

热点排行