Board index » cppbuilder » Using VCL components in Non-VCL components
glen
![]() CBuilder Developer |
Tue, 03 Aug 2004 22:13:00 GMT
Using VCL components in Non-VCL components
Hello again,
I have a large project that management wishes to be ANSI as much as possible/practical. Realizing that the Windows/GUI portion is not practical to be ANSI, we wish to segregate the VCL/GUI stuff from that that does not require windows interface, then compile those sections enforcing ANSI standards. My question is this: Can I include VCL components (non-visual ones of course, like TTimer, TIdTCPClient etc.) in non-VCL (ie ordinary classes - not PACKAGES) components? Using the Borland's TCounter example as a guide, I tried, only to get errors when trying to instantiate the VCL components in the constructor (using the same format that works using PACKAGES). Below is an example of what I tried. Can this be done? Thanks in advance. glenn //------------------------------------------------------------------------- typedef void (__closure *TCounterEvent)(TCounter *Sender); Quote}; //------------------------------------------------------------------------- Quote} void TCounter::Clear() { FVal = 0; Quote} void TCounter::Increment() { if (((++FVal) % FMultiple) == 0) OnMultiple(this); Quote} |