我在用EnumChildWindows(wnd,EnumWindowsProc,(LPARAM)0);编译时老是出错:
--------------------Configuration: bb - Win32 Debug--------------------
Compiling...
bbView.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\bb\bbView.cpp(111) : error C2664: 'EnumChildWindows' : cannot convert parameter 2 from 'int' to 'int (__stdcall *)(struct HWND__ *,long)'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
Creating browse info file...bb.exe - 1 error(s), 0 warning(s)
//
BOOL CALLBACK EnumChildProcq(
HWND hwnd, // handle to child window
LPARAM lParam // application-defined value
)
{
return true;
}
--------------------Configuration: bb - Win32 Debug--------------------
Compiling...
bbView.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\bb\bbView.cpp(111) : error C2664: 'EnumChildWindows' : cannot convert parameter 2 from 'int' to 'int (__stdcall *)(struct HWND__ *,long)'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
Creating browse info file...bb.exe - 1 error(s), 0 warning(s)
//
BOOL CALLBACK EnumChildProcq(
HWND hwnd, // handle to child window
LPARAM lParam // application-defined value
)
{
return true;
}
HWND *hwnd, // handle to child window
long lParam // application-defined value
)
{
return true;
}你声明的函数类型不对啊,按照要求声明看看
BOOL CALLBACK EnumChildProcq( //---------->BOOL CALLBACK EnumChildProc(
HWND hwnd, // handle to child window
LPARAM lParam // application-defined value
)
{
return true;
}
HWND hwnd, // handle to child window
LPARAM lParam // application-defined value
)
{
return true;
} 这样写应该是全局函数啦 全局函数不能随便写到一个。cpp那里的吗?