🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2876

Re: BDS2006 vs. C++Builder 5: EnumChildWindows

#2876
From: Ed Mulroy
Date: Sun, 17 Dec 2006 23:37
39 lines
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!
Technical Details
Message-ID: <4585d47b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4585d0e9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fb2c11c52da9b25c
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4585d0e9@newsgroups.borland.com>
Subject: Re: BDS2006 vs. C++Builder 5: EnumChildWindows
Date: Sun, 17 Dec 2006 18:37:21 -0500
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 66.57.117.102
Message-ID: <4585d47b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166398587 66.57.117.102 (17 Dec 2006 15:36:27 -0800)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail