Article View: borland.public.cppbuilder.nativeapi
Article #11189Re: to clarify further....
From: Andrue Cope
Date: Thu, 19 Feb 2004 16:08
Date: Thu, 19 Feb 2004 16:08
57 lines
2806 bytes
2806 bytes
On 19 Feb 2004 07:35:11 -0800, peter wrote: > the error 'Extra parameter in call' is from this line: > (Proc) ( szRunTypes,(char *)&rntyptable); > even though this call is consistent with the definition of the > SITE function, the address of which is supposed to be, theoretically, > in the 'Proc' variable. First of all the contents of 'Proc' are irrelevant at compile time because at compile time the variable doesn't even exist. That's the difference between 'compile time' and 'run time' :) Secondly even at run time the contents of 'Proc' are irrelevant. The code will attempt to call the function no matter what address is in it. There's no checking it can or will perform. Thirdly:what's with the brackets? Are they really in the example? That line is a normal, common or garden function call and Proc( szRunTypes, (char *)&rntyptable ); should be fine. This means that the situation you have is that you are trying to call a function and the compiler is telling you that you have supplied too many arguments. Forget it's a DLL exported function for the moment:that is irrelevant. I'm sure you've encountered this situation before and the remedy is always to double check the original parameter declaration. From your earlier thread you stated: > >What is MYPROC declared as exactly? Chances are, it is not declared > >correctly. > > it is declared like this: > > typedef VOID (*MYPROC)(LPTSTR); Now this is immediately a mismatch. This declares a pointer to a function that takes one argument. Unfortunately you've never given us the declaration of 'Proc' itself but if you have: MYPROC Proc; Then you've declared 'Proc' as pointing to a function that only takes one argument. What you need is: typdef VOID (*MYPROC)( ???, LPTSTR ); Where '???' is the type of 'szRunTypes'. -- Andrue Cope [Bicester UK]
Technical Details
Message-ID:
<6jrf3vcn7byz.hpnavdhsmx42.dlg@40tude.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4034d732$1@newsgroups.borland.com> <4034d7af$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c9838237a73aa85e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-19 08:10:47 PST From: Andrue Cope <no.spam@spammy.com> Subject: Re: to clarify further.... Newsgroups: borland.public.cppbuilder.nativeapi User-Agent: 40tude_Dialog/2.0.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <4034d732$1@newsgroups.borland.com> <4034d7af$1@newsgroups.borland.com> Date: Thu, 19 Feb 2004 16:08:22 +0000 Message-ID: <6jrf3vcn7byz.hpnavdhsmx42.dlg@40tude.net> NNTP-Posting-Host: 217.207.223.34 X-Trace: newsgroups.borland.com 1077206921 217.207.223.34 (19 Feb 2004 08:08:41 -0800) Lines: 57 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail