TIdEncoderMIME Builder XE + Indy 10.5.7 access violation |
|
Hello, I have problem with TIdEncoderMIME component, when I create it dynamically. When I put it on form everything works fine. I found that CodingTable is null, probably Indy bug. I tried updating Indy component, but there is problem as well (The procedure entry point @Idheadercoderutf@initialization$qqrv could not be located in the dynamic link library IndyProtocols150.bpl). Can anyone help me?
Code snippet
TIdEncoderMIME *encoderPtr = new TIdEncoderMIME(NULL);
String result = encoderPtr->Encode(String("test")); //access violation (CodingTable is null)
delete encoderPtr;
C++ Builder XE Version 15.0.3953.35171 (with update 1)
Indy 10.5.7
Windows XP SP3
|
Re: TIdEncoderMIME Builder XE + Indy 10.5.7 access violation |
|
Sylwester wrote:
> Hello, I have problem with TIdEncoderMIME component, when I create
> it dynamically. When I put it on form everything works fine. I found
> that CodingTable is null, probably Indy bug.
It is not a bug in Indy, it is actually a bug in C++Builder itself. The
bug was addressed 3 years ago in Indy 10.5.8 SVN rev 4652 with the introduction
of the WORKAROUND_INLINE_CONSTRUCTORS define in IdCompilerDefines.inc, which
is commented as follows:
{code}
{$IFDEF CBUILDER}
// When generating a C++ HPP file, if a class has no explicit constructor
// defined and contains compiler-managed members (xxxString, TDateTime,
// Variant, DelphiInterface, etc), the HPP will contain a forwarding
// inline constructor that implicitally initializes those managed members,
// which will overwrite any non-default initializations performed inside
// of InitComponent() overrides! In this situation, the workaround is to
// define an explicit constructor that forwards to the base class constructor
// manually.
{$DEFINE WORKAROUND_INLINE_CONSTRUCTORS}
{$ENDIF}
{code}
> I tried updating Indy component, but there is problem as well (The
> procedure entry point @Idheadercoderutf@initialization$qqrv could
> not be located in the dynamic link library IndyProtocols150.bpl).
Indy does not use the IdHeaderCoderUTF unit anymore, it was replaced with
the IdHeaderCoderIndy unit. Any external packages that were compiled against
the older Indy packages will need to be recompiled accordingly.
--
Remy Lebeau (TeamB)
|