错误提示:Cannot convert 'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()' (5

  • 主题发起人 主题发起人 路远
  • 开始时间 开始时间

路远

Unregistered / Unconfirmed
GUEST, unregistred user!
错误提示:Cannot convert 'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()' (50分)<br />BOOL CALLBACK EnumWndProc(HWND, LPARAM);<br>HWND hChild;<br>int &nbsp;iChildClassLen;<br>TCHAR szChildClassName[10];<br>while (EnumWindows(EnumWndProc,NULL));<br>BOOL CALLBACK EnumWndProc(HWND hWnd, LPARAM lParam)<br>{<br>&nbsp; hChild = GetWindow(hwnd,GW_CHILD);<br>&nbsp; iChileClassLen = GetClassName(hChild, szChildClassName[10], 10);<br>&nbsp; if (strcmp(szChildClassName, TEXT("TEdit")))<br>&nbsp; {<br>&nbsp; &nbsp; SendMessage(hChild, WM_SETTEXT, 0, (LPARAM)"你定义的串"); <br>&nbsp; } &nbsp;<br>}<br><br>&nbsp;错误提示:<br>[C++ Error] Unit1.cpp(25): E2034 Cannot convert 'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()'<br>[C++ Error] Unit1.cpp(25): E2342 Type mismatch in parameter 'lpEnumFunc' (wanted 'int (__stdcall *)()', got 'int (__stdcall<br>*)(void *,long)')<br>[C++ Error] Unit1.cpp(26): E2108 Improper use of typedef 'BOOL'
 
[C++ Error] Unit1.cpp(25): E2034 Cannot convert 'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()'<br>声明的函数与调用格式不符。(好像后面的没有参数,而前面的有)<br><br>[C++ Error] Unit1.cpp(25): E2342 Type mismatch in parameter 'lpEnumFunc' (wanted 'int (__stdcall *)()', got 'int (__stdcall<br>*)(void *,long)')<br>类型不匹配<br><br>[C++ Error] Unit1.cpp(26): E2108 Improper use of typedef 'BOOL'<br>不正确的使用BOOL类型的变量,你定义的函数的返回值是BOOL,可是从你的函数体来看没有<br>返回值啊?<br><br>我感觉你的这些错误都是些语法小错误,仔细看看,排除应该没有问题。<br>
 
接受答案了.
 
后退
顶部