"Martin Moeller" <
XXXX@XXXXX.COM >wrote in message
Quote
Well, how do you see that? the hpp only includes the header and
you see that the constuctos/destructors are void. But the rest of
the lib could do astonishing extras, or not?
No. Just like C++, Pascal has to follow the rules that you cannot use
something that is not declared first. The HPP header files are just
IDE-generated C++ header files for the VCL's Pascal code, and as such as
(almost) an exact mirror of that code. If you do not see something declared
in the HPP files, then they most likely are not declared in the Pascal code
either. In order for a class to do something extra on top of its base
class, whether the class is written in Pascal or C++, the class's
declaration in the header must include declarations for the new
functionality, whether that be new members, overridden menbers, etc. As you
can clearly see, TListView does not declare anything new which
TCustomListView does not already have. And its generated
constructors/destructor are empty (which, btw, they don't even exist in the
Pascal code at all, the C++ IDE auto-generated them only for the sake of the
HPP code being compliant with the C++ language).
Besides, Boland distributes the VCL source code anyway, so I can tell you
with 100% certainty that TListView does not do anything extra at all.
Quote
Ok, but they all compile and work except Colums.
Columns (plural) works fine for me. Did you use the EXACT code that I gave
you? I notice that you were trying to publish the Canvas and Column[]
(singular) properties before. You cannot publish those, as 1) they are both
read-only and you can only published read/write properties, and 2) you
cannot publish properties that use array notation. They both have to remain
public instead of published. And in fact they are both already declared as
public in TCustomListView, so there is no need to promote them anyway.
Quote
Got it. It means that installing (IDE) the actual constructor is
called and the objector inspector 'reads back' the values?
Component instances you see at design-time on a form are real instances.
They have been constructed normally and they reside in memory normally and
they are executing as if you were running outside of the IDE normally. So
yes, the Object Inspector is merely displaying the current values from an
actual running instance of the component. The only difference is that the
VCL has support for detecting the presence of the IDE so that is can
internally control how certain component actions behave, such as mouse
clicks and such. In all other regards, the component instance is real and
its coding is being executed as it would be outside of the IDE.
Quote
Which means a good component should properly set the default
value for all those properties which are set by the constructor?
Only those properties with values other than the defaults. No need to
reassign a value that is already assigned.
Quote
Not really.
Yes, really. I have been using custom RES files for all of my own
components for years and it works fine from BCB3 all the way of to BCB6
without problem.
Quote
I have a dcr (and not res) file, which may not be added.
I told you to creae a *new* RES file.
Some will say that it is possible to use DCR files. Some will say that they
have done it successfully. I believe them. However, I have never had a
single DCR file work correctly for me, which is why I always recommend RES
instead. Besides, DCR is a Delphi file anyway. For a C++ component, RES is
just easier to work with anyway, in my opinion.
Quote
A final question: how can you reload the component after modifications?
Simply recompile the package. If it is already installed, the IDE will
start using the new library files immediately.
Quote
I worked out a way ( Components | Install Package to remove the
entire bpl, then Components | Add Component to reinstall it)
That will work as well, though it is a little redundant.
Gambit
{smallsort}