VC6.0中如何写入API 10
我是新手不知道如何在VC6.0如何写入API函数?我想运行下API的例子,可不知道怎样做,我是这样做的:1."文件"->"新建"->"工程"菜单->win32Applic...
我是新手不知道如何在VC6.0如何写入API函数?我想运行下API的例子,可不知道怎样做,我是这样做的:
1."文件"->"新建"->"工程"菜单->win32 Application
2.起一个工程名如:api
3.在弹出的菜单中选择"An empty project",点击"完成",再点"确定"
4.在工作区右下点"FileView"视图,然后"Source Files"右击->"Add Files to folder",建立一个api.cpp文件
5.双击"api.cpp"写入代码
6.出现24个错误如下:
--------------------Configuration: api - Win32 Debug--------------------
Compiling...
api.cpp
h:\c++\api\api.cpp(2) : error C2061: syntax error : identifier 'UNIT'
h:\c++\api\api.cpp(3) : error C2061: syntax error : identifier 'hPrevInst'
h:\c++\api\api.cpp(4) : error C2731: 'WinMain' : function cannot be overloaded
h:\c++\api\api.cpp(3) : see declaration of 'WinMain'
h:\c++\api\api.cpp(7) : error C2065: 'WNDCALSS' : undeclared identifier
h:\c++\api\api.cpp(7) : error C2146: syntax error : missing ';' before identifier 'wndclass'
h:\c++\api\api.cpp(7) : error C2065: 'wndclass' : undeclared identifier
h:\c++\api\api.cpp(13) : error C2228: left of '.style' must have class/struct/union type
h:\c++\api\api.cpp(14) : error C2228: left of '.lpfnWndProc' must have class/struct/union type
h:\c++\api\api.cpp(15) : error C2065: 'wndClass' : undeclared identifier
h:\c++\api\api.cpp(15) : error C2228: left of '.cbClsExtra' must have class/struct/union type
h:\c++\api\api.cpp(16) : error C2228: left of '.cbWndExtra' must have class/struct/union type
h:\c++\api\api.cpp(17) : error C2228: left of '.hInstance' must have class/struct/union type
h:\c++\api\api.cpp(18) : error C2228: left of '.hIcon' must have class/struct/union type
h:\c++\api\api.cpp(18) : error C2065: 'IDL_APPLICATION' : undeclared identifier
h:\c++\api\api.cpp(19) : error C2228: left of '.hCurson' must have class/struct/union type
h:\c++\api\api.cpp(20) : error C2228: left of '.hbrBackground' must have class/struct/union type
h:\c++\api\api.cpp(21) : error C2228: left of '.lpszMenuName' must have class/struct/union type
h:\c++\api\api.cpp(22) : error C2228: left of '.lpszClassName' must have class/struct/union type
h:\c++\api\api.cpp(42) : error C2065: 'lpszClassNma' : undeclared identifier
h:\c++\api\api.cpp(42) : error C2065: 'lpszTite' : undeclared identifier
h:\c++\api\api.cpp(43) : error C2065: 'nCmdShow' : undeclared identifier
h:\c++\api\api.cpp(44) : error C2065: 'UpdataWindow' : undeclared identifier
h:\c++\api\api.cpp(54) : error C2601: 'WndProc' : local function definitions are illegal
h:\c++\api\api.cpp(64) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
api.exe - 24 error(s), 0 warning(s)
我用的是创天中文VC++6.0,到底用VC写API例子是怎样写的啊!!!!!!!!!!!怎么调用不了API的啊!!!!
具体步骤是什么啊!!!哪位高手教下我!!
书本叫<<Visual C++ 面向对象与可视化程序设计(第2版)>>清华大学版社,黄维通编著.代码在P76页.
因为不能写入太多,源代码看我的提问吧,好不意思!! 展开
1."文件"->"新建"->"工程"菜单->win32 Application
2.起一个工程名如:api
3.在弹出的菜单中选择"An empty project",点击"完成",再点"确定"
4.在工作区右下点"FileView"视图,然后"Source Files"右击->"Add Files to folder",建立一个api.cpp文件
5.双击"api.cpp"写入代码
6.出现24个错误如下:
--------------------Configuration: api - Win32 Debug--------------------
Compiling...
api.cpp
h:\c++\api\api.cpp(2) : error C2061: syntax error : identifier 'UNIT'
h:\c++\api\api.cpp(3) : error C2061: syntax error : identifier 'hPrevInst'
h:\c++\api\api.cpp(4) : error C2731: 'WinMain' : function cannot be overloaded
h:\c++\api\api.cpp(3) : see declaration of 'WinMain'
h:\c++\api\api.cpp(7) : error C2065: 'WNDCALSS' : undeclared identifier
h:\c++\api\api.cpp(7) : error C2146: syntax error : missing ';' before identifier 'wndclass'
h:\c++\api\api.cpp(7) : error C2065: 'wndclass' : undeclared identifier
h:\c++\api\api.cpp(13) : error C2228: left of '.style' must have class/struct/union type
h:\c++\api\api.cpp(14) : error C2228: left of '.lpfnWndProc' must have class/struct/union type
h:\c++\api\api.cpp(15) : error C2065: 'wndClass' : undeclared identifier
h:\c++\api\api.cpp(15) : error C2228: left of '.cbClsExtra' must have class/struct/union type
h:\c++\api\api.cpp(16) : error C2228: left of '.cbWndExtra' must have class/struct/union type
h:\c++\api\api.cpp(17) : error C2228: left of '.hInstance' must have class/struct/union type
h:\c++\api\api.cpp(18) : error C2228: left of '.hIcon' must have class/struct/union type
h:\c++\api\api.cpp(18) : error C2065: 'IDL_APPLICATION' : undeclared identifier
h:\c++\api\api.cpp(19) : error C2228: left of '.hCurson' must have class/struct/union type
h:\c++\api\api.cpp(20) : error C2228: left of '.hbrBackground' must have class/struct/union type
h:\c++\api\api.cpp(21) : error C2228: left of '.lpszMenuName' must have class/struct/union type
h:\c++\api\api.cpp(22) : error C2228: left of '.lpszClassName' must have class/struct/union type
h:\c++\api\api.cpp(42) : error C2065: 'lpszClassNma' : undeclared identifier
h:\c++\api\api.cpp(42) : error C2065: 'lpszTite' : undeclared identifier
h:\c++\api\api.cpp(43) : error C2065: 'nCmdShow' : undeclared identifier
h:\c++\api\api.cpp(44) : error C2065: 'UpdataWindow' : undeclared identifier
h:\c++\api\api.cpp(54) : error C2601: 'WndProc' : local function definitions are illegal
h:\c++\api\api.cpp(64) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
api.exe - 24 error(s), 0 warning(s)
我用的是创天中文VC++6.0,到底用VC写API例子是怎样写的啊!!!!!!!!!!!怎么调用不了API的啊!!!!
具体步骤是什么啊!!!哪位高手教下我!!
书本叫<<Visual C++ 面向对象与可视化程序设计(第2版)>>清华大学版社,黄维通编著.代码在P76页.
因为不能写入太多,源代码看我的提问吧,好不意思!! 展开
4个回答
展开全部
把源代码粘上来,好似少#include了头文件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你又没有描述你的api.cpp是怎样的.所以不知道哪里有错误。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
好像不是An empty project吧,我去年学的时候冒似不是这样,具体是怎么样,忘了,嘿嘿
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询