How do I create your objects dynamically in C++ Builder?

How do I create your objects dynamically in C++ Builder?

Date Entered: 7/12/2004    Last Updated: 04/28/2016

Instead of dropping the component on a form, the component can be created dynamically in code. For instance:

TipwIPPort* ipp; ipp = new TipwIPPort(NULL, TRUE);

To bind an event, declare a class that implements the event, then assign the event handler. For instance:

class MyClass { public: void __fastcall ipportDataIn(TObject* Sender, TipwIPPortDataInEventParams *e) { printf("DataIn: %s\n",e->Text); } }; int _tmain(int argc, _TCHAR* argv[]) { TipwIPPort* ipport = new TipwIPPort(NULL); MyClass* myClass = new MyClass(); ipport->OnDataIn = myClass->ipportDataIn; // ... }

We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.