| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1366 人关注过本帖
标题:为什么vc++6下不能执行?
只看楼主 加入收藏
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
 问题点数:0 回复次数:12 
为什么vc++6下不能执行?
书上的例子,在集成开发环境7.4下可以执行啊
搜索更多相关主题的帖子: 开发 
2007-03-17 09:16
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 

//The project file is FRAME.IDE
//Source file is FRAME.C
//The framework of Windows 98 Applicationhas no
//resource file, header file, and definition file
#include "windows.h"

LRESULT CALLBACK WindowFunc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
char szWinName [] = "MyWin";
int WINAPI WinMain (HINSTANCE hThisInst, HINSTANCE hPrevinst, LPSTR IpszArgs, int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASS wcl;

wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowFunc;
wcl.style = 0;
wcl.hIcon = LoadIcon (NULL,IDI_APPLICATION);
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);

if (! RegisterClass (&wcl) ) return 0;

hwnd = CreateWindow (
szWinName,
"试验",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
NULL,
hThisInst,
NULL
);

ShowWindow (hwnd, nWinMode);
UpdateWindow (hwnd);

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

LRESULT CALLBACK WindowFunc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}

2007-03-17 09:16
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 

#include "windows.h"

LRESULT CALLBACK WindowFunc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
char szWinName [] = "MyWin";
int WINAPI WinMain (HINSTANCE hThisInst, HINSTANCE hPrevinst, LPSTR IpszArgs, int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASS wcl;

wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowFunc;
wcl.style = 0;
wcl.hIcon = LoadIcon (NULL,IDI_APPLICATION);
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);

if (! RegisterClass (&wcl) ) return 0;

hwnd = CreateWindow (
szWinName,
"试验",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
NULL,
hThisInst,
NULL
);

ShowWindow (hwnd, nWinMode);
UpdateWindow (hwnd);

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

2007-03-17 09:17
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 


#include "windows.h"

LRESULT CALLBACK WindowFunc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
char szWinName [] = "MyWin";
int WINAPI WinMain (HINSTANCE hThisInst, HINSTANCE hPrevinst, LPSTR IpszArgs, int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASS wcl;

wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowFunc;
wcl.style = 0;
wcl.hIcon = LoadIcon (NULL,IDI_APPLICATION);
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);

2007-03-17 09:18
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 


#include "windows.h"

LRESULT CALLBACK WindowFunc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
char szWinName [] = "MyWin";
int WINAPI WinMain (HINSTANCE hThisInst, HINSTANCE hPrevinst, LPSTR IpszArgs, int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASS wcl;

[此贴子已经被作者于2007-3-17 9:19:14编辑过]

2007-03-17 09:18
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 
wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowFunc;
wcl.style = 0;
wcl.hIcon = LoadIcon (NULL,IDI_APPLICATION);
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);
2007-03-17 09:19
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 
wcl.hInstance = hThisInst;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowFunc;
wcl.style = 0;
wcl.hIcon = LoadIcon (NULL,IDI_APPLICATION);
2007-03-17 09:19
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);
2007-03-17 09:20
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject (WHITE_BRUSH);
2007-03-17 09:20
cfnxy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-2-17
收藏
得分:0 
wcl.hCursor = LoadCursor (NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
2007-03-17 09:20
快速回复:为什么vc++6下不能执行?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024122 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved