c++builder-5

Event Handler for Dynamically Created CheckBox

独自空忆成欢 提交于 2019-12-13 19:26:13
问题 I wrote a C++ program using Borland C++ Builder 5. The program dynamically creates an array of TCheckBox objects. I have tried to write an OnClick event handler that would identify which checkbox is being clicked and execute some instructions based on that. My event handler is based on similar posts to this website, but I cannot seem to make it work. Here is the (abbreviated) code // Header declaration void __fastcall CBoxClick(TObject *Sender); // End Header // CBoxClick function (the event

Iterate Over Struct; Easily Display Struct Fields And Values In a RichEdit Box

让人想犯罪 __ 提交于 2019-11-28 18:55:27
Is there an easier way to display the struct fields and their corresponding values in RichEdit control? This is what I am doing now: AnsiString s; s = IntToStr(wfc.fontColor); RichEdit1->Lines->Append(s); etc... Is there an easier way than having to individually call each one? I want to read a binary file and then display the corresponding structure in a RichEdit control for a small utility I am building and have found no other way. I know how to read binary files and read the values into the struct already. BOOST_FUSION_ADAPT_STRUCT seems to fit well here. For example: // Your existing struct