Article View: borland.public.cppbuilder.nativeapi
Article #11193Re: to clarify further....
From: peter
Date: Thu, 19 Feb 2004 16:36
Date: Thu, 19 Feb 2004 16:36
50 lines
2351 bytes
2351 bytes
>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' :) that makes sense now. thanks >Thirdly:what's with the brackets? Are they really in the example? yes, and i thought that was weird too, but i don't know any better since it is my first time working with run-time linking. >> >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] that all made perfect sense once I heard it spelled out like that. I changed my definition of MYPROC to this: typedef int (*MYPROC)(LPTSTR ,LPTSTR); since both parameters are of type 'char *' However, now I am now getting this error: [C++ Error] nycdsur040.cpp(7267): E2034 Cannot convert 'int (__stdcall *)()' to 'int (*)(char *,char *)' it acts as though it has the function declared already.
Technical Details
Message-ID:
<4034e625$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.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> <6jrf3vcn7byz.hpnavdhsmx42.dlg@40tude.net>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:41:04 PST From: "peter" <peterna@attglobal.net> Sender: "peter" <peterna@attglobal.net> Reply-To: "peter" <peterna@attglobal.net> Subject: Re: to clarify further.... Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 66.88.112.2 References: <4034d732$1@newsgroups.borland.com> <4034d7af$1@newsgroups.borland.com> <6jrf3vcn7byz.hpnavdhsmx42.dlg@40tude.net> NNTP-Posting-Host: 207.105.83.66 Message-ID: <4034e625$1@newsgroups.borland.com> Date: 19 Feb 2004 08:36:53 -0800 X-Trace: newsgroups.borland.com 1077208613 207.105.83.66 (19 Feb 2004 08:36:53 -0800) Lines: 53 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail