When I try to compile the following in MinGW 4.6.2
EnumChildWindows(hwnd, [](HWND, LPARAM) -> BOOL { return TRUE; }, 0);
I get
error: cannot convert '<lambda(HWND, LPARAM)>'
to 'ENUMWINDOWSPROC {aka int (*)(HWND__*,long int)}'
for argument '2' to 'BOOL EnumChildWindows(HWND, ENUMWINDOWSPROC, LPARAM)'
Am I declaring a lambda incorrectly, or is it just not working? MS Callback Definition
BOOL CALLBACK EnumChildProc(
__in HWND hwnd,
__in LPARAM lParam
);
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633493%28v=vs.85%29.aspx
Is the calling convention causing the problem?
source
share