Tables in CBuilder

General TRichView support forum. Please post your questions here
Post Reply
KaptainKarl
Posts: 5
Joined: Tue Oct 16, 2007 9:22 pm

Tables in CBuilder

Post by KaptainKarl »

Hello,

This is newbie question.
How do I instantiate a table in CBuilder?
The Help file refers to a function called CreateEx which does not seem to exist. I attempted a "new" of a table object and got an exception.

Sorry for such a simple question, but I cannot seem to find the answer on my own.

Karl
KaptainKarl
Posts: 5
Joined: Tue Oct 16, 2007 9:22 pm

Additional Information

Post by KaptainKarl »

I have scoured the help and tried many different things. I'm sure I am missing something very easy. Here is the code I have tried:

These will not compile:
TRVTableItemInfo rvTable;
TRVTableItemInfo *rvTable = new TRVTableItemInfo();

These throw an exception:
TRVTableItemInfo *rvTable = new TRVTableItemInfo(0);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(this);
TRVTableItemInfo *rvTable = new TRVTableItemInfo(rvDoc);

This (as expected) also throws and exception:
TRVTableItemInfo *rvTable;
rvDoc->AddItem("Lot Table", rvTable);

I listed all the methods associated with TRVTableItemInfo by entering TRVTableItemInfo:: and clicking Cntrl-Space. The methods "Create" and "CreateEx" do NOT show in the list of methods.

Using formated text in addNL lines is not an option for me since I need three columns of information and the tabs are not consistent between RTF output and PDF output. I also would like to put some borders around some of the fields.

If there is a simple CBuilder example of how to instantiate a table, please let me know.

Thanks,

Karl
KaptainKarl
Posts: 5
Joined: Tue Oct 16, 2007 9:22 pm

More Info

Post by KaptainKarl »

I left this attempt out of my previous post:

TRVTableItemInfo *rvTable;
rvTable = TRVTableItemInfo::CreateEx(2, 3, rvDoc->RVData);

This will not compile with the error "Undefined symbol 'CreateEx'".

Karl
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Delphi constructors are converted to C++ constructors with the same parameters (but without name, because C++ constructors do not have names).
So the code is:
rvTable = new TRVTableItemInfo(2, 3, rvDoc->RVData);

For example of creating tables, see Demos\CBuilder\Editors\Editor 1\, commands in "Table" menu.
KaptainKarl
Posts: 5
Joined: Tue Oct 16, 2007 9:22 pm

Post by KaptainKarl »

I figured I was doing something stupid.
Thank you very much.

Karl
Post Reply