Sorry for this newbie question.
From the lcc-win32 user manual.
--8<--
The framework provided by lcc-win32 centers about providing a simple
interface for calling all the functions associated with a certain control.
The general syntax for using this objects is:
object->Method(arguments)
This is a short hand for the normmaly used C syntax, that has ben
simplified. In strict C you woould be required to write:
object->lpVtbl->Method(object,arguments);
--8<---
I'm puzzled about this. Does this mean that lcc supports some kind of C++
style method calling, or this is achieved with macros or some such? What is
'the framework' to which it refers? Where shoudl I be looking to read about
this stuff?
Thanks
John Vaudin
mailto:john@vaudin.net
|
|
0
|
|
|
|
Reply
|
John
|
7/3/2003 5:13:11 PM |
|
"John Vaudin" <john@vaudin.net> wrote in message
news:be1o7p$aij$1$8302bc10@news.demon.co.uk...
> Sorry for this newbie question.
>
> From the lcc-win32 user manual.
>
> --8<--
>
> The framework provided by lcc-win32 centers about providing a simple
> interface for calling all the functions associated with a certain control.
> The general syntax for using this objects is:
>
> object->Method(arguments)
>
> This is a short hand for the normmaly used C syntax, that has ben
> simplified. In strict C you woould be required to write:
>
> object->lpVtbl->Method(object,arguments);
>
I can't find any of that in the lcc-win32 docs.
> I'm puzzled about this. Does this mean that lcc supports some kind of C++
> style method calling, or this is achieved with macros or some such? What
is
> 'the framework' to which it refers? Where shoudl I be looking to read
about
> this stuff?
An example that might help using these methods is on my web site in the
libraries section. It's called 'StringObject'.
John
|
|
0
|
|
|
|
Reply
|
John
|
7/3/2003 6:39:10 PM
|
|
"John" <John.zzzPortal@btinternet.com> wrote in message news:be1t7a$cpgq$1@ID-97861.news.dfncis.de...
>
> "John Vaudin" <john@vaudin.net> wrote in message
> news:be1o7p$aij$1$8302bc10@news.demon.co.uk...
> > Sorry for this newbie question.
> >
> > From the lcc-win32 user manual.
> >
> > --8<--
> >
> > The framework provided by lcc-win32 centers about providing a simple
> > interface for calling all the functions associated with a certain control.
> > The general syntax for using this objects is:
> >
> > object->Method(arguments)
> >
> > This is a short hand for the normmaly used C syntax, that has ben
> > simplified. In strict C you woould be required to write:
> >
> > object->lpVtbl->Method(object,arguments);
> >
>
> I can't find any of that in the lcc-win32 docs.
It is under the Table of Contents listing "The Framework"
Robert Wishlaw
|
|
0
|
|
|
|
Reply
|
Robert
|
7/4/2003 1:01:22 AM
|
|
"Andi.Martin" <Andi.Martin@freenet.de> wrote in message
news:be28sd$6qt$00$1@news.t-online.com...
> Hi John,
>
> lcc does not access to C++Object in that manner you mean...
> And a trick or non C isn't it too! The docs only try to open your mind and
> see that some things in C++ are useful but not even necessary or
> improvement.
> So if you look how objects work (and they also have to serve to mnemonics
of
> your ICs) you would see, that this is accessable even in assembler, so it
is
> in C too.
> So called "virtual method tables (VMT)" in C++ are only a structure of
> function pointers and this is a really old thing in C.
>
> Example:
:
> You have now an "object", which is accessible like that:
> x=MyObject->Vtbl->GetXValueFunc(MyObject);
I understand function pointers, and I understand how C++ implements virtual
functions using vtbls.
I have a very specific question though.
In your example you use
obj->vtbl->method(args)
No problem - I understand this.
BUT the documentation says
> > The general syntax for using this objects is:
> >
> > object->Method(arguments)
> >
> > This is a short hand for the normmaly used C syntax, that has ben
> > simplified. In strict C you woould be required to write:
> >
> > object->lpVtbl->Method(object,arguments);
Which implies to me that I can rewrite
obj->vtbl->method(args) as obj->method(args)
Either the documentation is wrong and this is not true, or LCC implements
some kind of language extention to allow this syntax.
I really just want to know which it is. I am begining to suspect that the
documentation is misleading, but I'd be grateful if someone could explain.
Thanks
John
|
|
0
|
|
|
|
Reply
|
John
|
7/4/2003 10:20:30 PM
|
|
"John Vaudin" <john@vaudin.net> wrote in message
news:be4ujj$as3$1$8300dec7@news.demon.co.uk...
>
> Which implies to me that I can rewrite
>
> obj->vtbl->method(args) as obj->method(args)
Or even obj.method()
> Either the documentation is wrong and this is not true, or LCC implements
> some kind of language extention to allow this syntax.
Yes, it's an extension.
As I wrote before.
===============
An example that might help using these methods is on my web site in the
libraries section. It's called 'StringObject'.
===============
http://www.btinternet.com/~john.findlay1/
http://www.john.findlay1.btinternet.co.uk/
John
|
|
0
|
|
|
|
Reply
|
John
|
7/5/2003 5:57:53 AM
|
|
"John" <John.zzzPortal@btinternet.com> wrote in message
news:be5pbi$1f6p1$1@ID-97861.news.dfncis.de...
>
> "John Vaudin" <john@vaudin.net> wrote in message
> news:be4ujj$as3$1$8300dec7@news.demon.co.uk...
> >
> > Which implies to me that I can rewrite
> >
> > obj->vtbl->method(args) as obj->method(args)
>
> Or even obj.method()
>
> > Either the documentation is wrong and this is not true, or LCC
implements
> > some kind of language extention to allow this syntax.
>
> Yes, it's an extension.
>
> As I wrote before.
> ===============
> An example that might help using these methods is on my web site in the
> libraries section. It's called 'StringObject'.
> ===============
I have looked at the example. It answers some of my questions but not all.
In C++ the compiler knows to do this because you have a reference to an
object of some class with a virtual function defined on it. How does LCC
know to apply this magic? Is the name pVtbl magic in some way? I'd still
like to see some kind of documentation.
I have looked through the section on 'Special Features of lcc-win32' and I
can see no mention of this extension. I'm sure, given a spare moment, I
could knock up some test cases and deduce the bahviour, but I don't really
think that should be necessary.
John
|
|
0
|
|
|
|
Reply
|
John
|
7/7/2003 9:01:57 AM
|
|
"John Vaudin" <john@vaudin.net> wrote in message
news:bebcu7$u5$1$8300dec7@news.demon.co.uk...
<snip>
>
> I have looked at the example. It answers some of my questions but not all.
>
> In C++ the compiler knows to do this because you have a reference to an
> object of some class with a virtual function defined on it. How does LCC
> know to apply this magic? Is the name pVtbl magic in some way? I'd still
> like to see some kind of documentation.
Can't help with the documentation but yes, it's a special feature added by
Jacob.
When used in the fashion shown by my example the object is implicit and
passed as the first parameter.
Depending on if the object is a pointer to struct you would do
obj->Func(something);
If the object is a struct you would do
obj.Func(something);
I don't know what else to say - :)
John
|
|
0
|
|
|
|
Reply
|
John
|
7/7/2003 10:22:55 AM
|
|
"Robert Wishlaw" <rwishlaw@shaw.ca> wrote in message
news:Cl4Na.351759$3C2.9505612@news3.calgary.shaw.ca...
>
> "John" <John.zzzPortal@btinternet.com> wrote in message
news:be1t7a$cpgq$1@ID-97861.news.dfncis.de...
> >
> > "John Vaudin" <john@vaudin.net> wrote in message
> > news:be1o7p$aij$1$8302bc10@news.demon.co.uk...
> > > Sorry for this newbie question.
> > >
> > > From the lcc-win32 user manual.
> > >
> > > --8<--
> > >
> > > The framework provided by lcc-win32 centers about providing a simple
> > > interface for calling all the functions associated with a certain
control.
> > > The general syntax for using this objects is:
> > >
> > > object->Method(arguments)
> > >
> > > This is a short hand for the normmaly used C syntax, that has ben
> > > simplified. In strict C you woould be required to write:
> > >
> > > object->lpVtbl->Method(object,arguments);
> > >
> >
> > I can't find any of that in the lcc-win32 docs.
>
> It is under the Table of Contents listing "The Framework"
Thanks Robert, only just found it in lcc.chm !!
Perhaps it should be called
lcc-win32_user_manual.chm
John
|
|
0
|
|
|
|
Reply
|
John
|
7/8/2003 8:22:56 AM
|
|
|
7 Replies
192 Views
(page loaded in 0.052 seconds)
Similiar Articles: MailTo syntax - comp.lang.javascriptNon-standard C features? - comp.compilers.lcc Where shoudl I be looking to read about this stuff? Thanks John Vaudin mailto:john ... BUT the documentation says > > The ... Non-standart Baudrate - comp.soft-sys.matlab... stuff in C, you are not talking about standard C, you are talking about non standard ... set the XL-DC baud rate ... The Sun Fire V210 server features a single (non ... Wide Preprocessor Concatenation - comp.lang.c++.moderated ...(VC6?) <snip> VC++ 6 has a lot of non-standard "features". That doesn't mean everyone should work around them. The standard says __LINE__ expands to a decimal constant ... code speed moving from fortran 77 compiler to f2003 compiler ...ii) FOR_C may choke on many of the non-standard F77 extensions used in your code. ... therefore as large as the step from Fortran 77 to C if the new features are ... Which has faster access Binary Search of std::vector or std::set ...UTC seconds to actual time. - comp.lang.c C's standard time ... ... nets I originally normalised across my entire feature ... is typically faster ... best, and while non-standard, hash ... error LNK2019: unresolved external symbol _main referenced in ...This particular function calls a standard C or C++ ... The others call other non-standard startup functions ... as a text editor view, there are lots of features ... inquire size of a file - comp.lang.fortranIt is not a standard f95 feature (unless my eyes crossed while checking, but I did check ... GCC 4.5. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43409 As a non-standard ... Secure FTP API for Java Released - comp.lang.java.security ...Some of the features of Secure FTP API for Java are: Complete implementation of ... Extendable architecture to support legacy/non-standard FTP servers Event notification ... size of a derived type containing pointers... - comp.lang.fortran ...I showed in a previous posting how to do the same thing using only standard features ... The question now is whether customers will demand the warnings for non-standard ... Convert UTC seconds to actual time. - comp.lang.c> > The Standard describes the features of C that are common to > all platforms. ... This doesn't quite work if you cross a century non-4century year ... C (programming language) - Wikipedia, the free encyclopedia... standard specification of C. X3J11 based the C standard on the Unix implementation; however, the non ... The C11 standard adds numerous new features to C and the library ... C++ - Wikipedia, the free encyclopediaWithin functions that define a non-void return type, failure ... have been removed by the 1999 revision of the C standard , which now supports C++ features such as line ... 7/7/2012 7:59:53 PM
|