| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 618 人关注过本帖
标题:请问这个强制转换怎么做?
只看楼主 加入收藏
wangzhenyu
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-31
收藏
 问题点数:0 回复次数:0 
请问这个强制转换怎么做?

long FAR PASCAL Wndfun(HWND hWnd,UINT mes, WPARAM wParam,LPARAM lParam)
{ HWND hcre,hin,hth,hex,hqu;
RECT w;
for(;;)
{
switch(mes)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_COMMAND:
{
if(LOWORD(lParam)==(int)hcre) creatKB( );
if(LOWORD(lParam)==(int)hin) inputDB( );
if(LOWORD(lParam)==(int)hth) think( );
if(LOWORD(lParam)==(int)hex) explain( );
if(LOWORD(lParam)==(int)hqu)
{
freeKB(KnowledgeBase);
freeKB(Used);
freeDB(DataBase);
freeDB(Conclusion);
DestroyWindow(hWnd);
PostQuitMessage(0);
}
return(0);
}
case WM_CREATE:
GetClientRect(hWnd,&w);
hcre=CreateWindow("BUTTON","创建知识库",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,40,30,100,25,hWnd,0, hCurInst, NULL);
hin=CreateWindow("BUTTON", "输入已知事实",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
40,6, 100,25,hWnd,1,hCurInst,NULL);
hth=CreateWindow("BUTTON","进行推理",WS_CHILD|
WS_VISIBLE|BS_PUSHBUTTON,40,90,100,25,hWnd,2,hCurInst,NULL);
hex=CreateWindow("BUTTON","解释",WS_CHILD|
WS_VISIBLE|BS_PUSHBUTTON,40,120,100,25,hWnd,3,hCurInst,NULL);

--------------------Configuration: 动物2 - Win32 Debug--------------------
Compiling...
动物.cpp
c:\program files\microsoft visual studio\myprojects\动物2\动物.cpp(123) : error C2664: 'CreateWindowExA' : cannot convert parameter 11 from 'void *' to 'struct HINSTANCE__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\program files\microsoft visual studio\myprojects\动物2\动物.cpp(134) : error C2664: 'CreateWindowExA' : cannot convert parameter 10 from 'const int' to 'struct HMENU__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\microsoft visual studio\myprojects\动物2\动物.cpp(136) : error C2664: 'CreateWindowExA' : cannot convert parameter 10 from 'const int' to 'struct HMENU__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\microsoft visual studio\myprojects\动物2\动物.cpp(138) : error C2664: 'CreateWindowExA' : cannot convert parameter 10 from 'const int' to 'struct HMENU__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\microsoft visual studio\myprojects\动物2\动物.cpp(140) : error C2664: 'CreateWindowExA' : cannot convert parameter 10 from 'const int' to 'struct HMENU__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast


搜索更多相关主题的帖子: return 
2006-06-08 11:21
快速回复:请问这个强制转换怎么做?
数据加载中...
 
   



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

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