CPB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TMainMenu/TMenuItem bug?
>I have attached two very simple projects. One is the correctly working
>Delphi version. The second is the equivalent C++ project. From what I can
>tell of the VCL source and from on-line help, TMainMenu->Items is supposed
>to return TMenuItem*, but instead appears to be returning TMenuItem. In
>any event, I cannot dereference past TMainMenu->Items[0] even though
>TMainMenu->Items->Count is greater than 1.
>
>This looks like a genuine bug. Can anyone verify this or tell me what I'm
>doing wrong?
This is no bug. You are making a genuine mistake... I can sypathesize since
I have been boggled by this a great deal.
To get to the items of the menu you need to write:
TMainMenu->Items->Item[index]
and not just the
TMainMenu->Items[index]
The irony is that the wrong way is the most natural way and you are right to
expect it to be this way. Unfortunately it is not and there are other
instances of similar 'wrong' implementation of array items in the VCL though
I cannot recall right away...
Rehan.
W Komornicki's Home Page |
Main Index |
Thread Index