#31 C++Builder 2010: SetPort linker error

open
nobody
None
5
2010-09-15
2010-09-15
PKy
No

C++Builder won't link if you use the Port property. Below is a workaround. I don't know if this is because TPort is typedeffed as string, and hence the linker try to use UnicodeString as the type for SetPort function.

To TCustomComPort 's interface part, like line 428

// PKy 7.9.2009. Easier portability to C++ Builder which doesn't like TPort for some reason
procedure SetPortString(const Value: string);

And to implementation part to TCustomComPort, like before TCustomComPort.SetPort:

// PKy 7.9.2009. Help using on C++ Builder 2007
// set port
procedure TCustomComPort.SetPortString(const Value: string);
var
LPort:TPort;
begin
LPort := Value;
SetPort(LPort);
end;

Now use SetPortString instead of Port="COM1"

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks