🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Compiler error

#17492
From: Ed Mulroy [TeamB]
Date: Wed, 12 Mar 2003 02:33
43 lines
2296 bytes
The error message hinges on the definition of the typedef PROCENUMPROC but
that definition is not shown in the message.

The error message suggests that it is a declaration of a pointer to a
CALLBACK function taking an argument list whose third argument is a char* or
LPSTR but the function whose name was used as the pointer argument in the
code had a third  argument of const char* or LPCSTR.

.  Ed

> Terry wrote in message
> news:3e6e976e$1@newsgroups.borland.com...
> I have been staring at this and i just cannot figure out what
> is causing the error.
>
> BOOL WINAPI EnumProcs(PROCENUMPROC lpProc,
>  LPARAM lParam)
> {
>     //code
> }
>
> BOOL CALLBACK ProcessEnumProc(DWORD dw,
> WORD w16, LPCSTR lpstr, LPARAM
> lParam)
> {
>     // code
> }
>
> void __fastcall TForm1::ToolButton1Click(TObject *Sender)
> {
>     EnumProcs(ProcessEnumProc, (LPARAM)ListView1);
>  << the error below
> [C++ Error] Unit1.cpp(354): E2034 Cannot convert
> 'int (__stdcall*)(unsigned long, unsigned short, const char *,long)'
> to
> 'int (__stdcall*)(unsigned long, unsigned short, char *,long)'
>
> [C++ Error] Unit1.cpp(354): E2342 Type mismatch in parameter
> 'lpProc' (wanted
> 'int (__stdcall *)(unsigned long,unsigned short,char *,long)',
> got
> 'int (__stdcall *)(unsigned long,unsigned short,const char *,long)')
> }
Technical Details
Message-ID: <3e6e9c6d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e6e976e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,804592ee0e8d4a4e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-03-12 18:26:05 PST
From: "Ed Mulroy [TeamB]" <ed@mulroy.org>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e6e976e$1@newsgroups.borland.com>
Subject: Re: Compiler error
Date: Tue, 11 Mar 2003 21:33:09 -0500
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 24.74.175.102
Message-ID: <3e6e9c6d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1047436397 24.74.175.102 (11 Mar 2003 18:33:17 -0800)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail