🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: EnumResourceNames

#7132
From: Ed Mulroy [TeamB]
Date: Mon, 14 Mar 2005 22:23
60 lines
2668 bytes
With the description of only "will not compile" this is not something 
one can do much with.  You do not show the error message text so I can 
only guess.

My guess is that the callback function is found later in the source 
code and no function prototype is provided so that, at the point 
EnumResourceNames is called, EnumResProc is not yet defined.

.  Ed

> jB wrote in message
> news:4235f905@newsgroups.borland.com...
> Could someone please advise me why my callback function will not 
> compile.
>
> Thanks
>
> jB
>
> /---------------------------------------------------------------------------
> void __fastcall TForm1::Button2Click(TObject *Sender)
> {
>        try
>        {
>                try
>                {
>                        hResourceDLL = 
> LoadLibrary(Edit1->Text.c_str());
>                        EnumResourceNames(hResourceDLL,
>                        "RT_ICON",
>                        EnumResProc,
>                        NULL
>                         );
>                }
>                catch(...)
>                {
>                        MessageDlg("Cannot Load Library", mtError, 
> TMsgDlgButtons() << mbOK, 0);
>                }
>        }
>        __finally
>        {
>                FreeLibrary (hResourceDLL);
>        }
>
> }
> //---------------------------------------------------------------------------
>
> BOOL CALLBACK EnumResProc(  HMODULE hModule,   LPTSTR  lpszType, 
> char * lpszName,  long lParam )
> {
>
>   if( 0 == strcmp( lpszType, "RT_ICON" ) ||
>         0 == strcmp( lpszType,"RT_GROUP_ICON" ) )
>   {
>                        iTotalIcons++; // defined in header
>   }
>
>    return (true);
> }
Technical Details
Message-ID: <42360ee6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4235f905@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,da3abd9f4e77eb05
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@invalid.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4235f905@newsgroups.borland.com>
Subject: Re: EnumResourceNames
Date: Mon, 14 Mar 2005 17:23:13 -0500
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 66.61.146.71
Message-ID: <42360ee6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1110839014 66.61.146.71 (14 Mar 2005 14:23:34 -0800)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail