ComPort Library version 2.64

ComPort Library version 2.64

Post by Kevi » Sat, 10 Sep 2005 11:41:12


Hi,
I had a problem when using ComPort component. Please help me.

When I code
ComPort1->Port="COM1";

[Linker Error] Unresolved external '__fastcall
Cport::TCustomComPort::SetPortA(const System::AnsiString)' referenced from
C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
 
 
 

ComPort Library version 2.64

Post by Leroy Cast » Thu, 15 Sep 2005 07:38:25

ComPort is now hosted on SourceForge (www.SourceForge.net). Go there
and search for ComPort and you'll find the project. You'll find a 3.0x
version as well as a couple of fourms.

Here's the fix. You have to modify the ComPort.hpp file.

Search for the line:

void __fastcall SetPort(const AnsiString Value);

and change it to:

#ifdef SetPort
#undef SetPort
void __fastcall SetPort(const AnsiString Value);
#define SetPort SetPortA
#else
void __fastcall SetPort(const AnsiString Value);
#endif


Search for the line:

__property AnsiString Port = {read=FPort, write=SetPort};

and change it to:

#ifdef SetPort
#undef SetPort
__property AnsiString Port = {read=FPort, write=SetPort};
#define SetPort SetPortA
#else
__property AnsiString Port = {read=FPort, write=SetPort};
#endif


On Fri, 9 Sep 2005 10:41:12 +0800, "Kevin" < XXXX@XXXXX.COM >