Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages
Started by Udo Weik
Sun, 17 Dec 2006 23:23
BDS2006 vs. C++Builder 5: EnumChildWindows
Author: Udo Weik
Date: Sun, 17 Dec 2006 23:23
Date: Sun, 17 Dec 2006 23:23
22 lines
1676 bytes
1676 bytes
Hello,
EnumChildWindows is defined as follows:
BOOL EnumChildWindows( HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM lParam ) ;
With C++Builder 5, I used the following call:
EnumChildWindows( HANDLE, EnumFunct, PARAM ) ;
That does't work with BDS2006, I have gotten the following error message:
[C++ Error] ...: E2034 Cannot convert 'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()'
[C++ Error] ...: E2342 Type mismatch in parameter 'lpEnumFunc' (wanted 'int (__stdcall *)()',
got 'int (__stdcall *)(void *,long)')
After casting EnumFunct as WNDENUMPROC
EnumChildWindows( HANDLE, (WNDENUMPROC)EnumFunct, PARAM ) ;
compiling was successful.
Any comments would be highly appreciated!
Thanks and greetings
Udo
Re: BDS2006 vs. C++Builder 5: EnumChildWindows
Author: Ed Mulroy
Date: Sun, 17 Dec 2006 23:37
Date: Sun, 17 Dec 2006 23:37
39 lines
2261 bytes
2261 bytes
Double check that you implentation of EnumFunc is declared as either of WINAPI or __stdcall If that isn't it then try this: Define STRICT either in your project or in your source file before any includes. As in: #define STRICT STRICT is a Microsoft creation added when they added having their compiler actually look a the number types calling arguments to a function (such as Borland had done for a long while). Use of it appears in their licensed Windows header files. . Ed > Udo Weik wrote in message > news:4585d0e9@newsgroups.borland.com... > > EnumChildWindows is defined as follows: > BOOL EnumChildWindows( HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM > lParam ) ; > > With C++Builder 5, I used the following call: > EnumChildWindows( HANDLE, EnumFunct, PARAM ) ; > > That does't work with BDS2006, I have gotten the following error message: > [C++ Error] ...: E2034 Cannot convert 'int (__stdcall *)(void *,long)' > to 'int (__stdcall *)()' > [C++ Error] ...: E2342 Type mismatch in parameter 'lpEnumFunc' (wanted > 'int (__stdcall *)()', > got 'int (__stdcall *)(void *,long)') > > After casting EnumFunct as WNDENUMPROC > EnumChildWindows( HANDLE, (WNDENUMPROC)EnumFunct, PARAM ) ; > compiling was successful. > > Any comments would be highly appreciated!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads