Mega Search
23.2 Million


Sign Up

Make a donation  
TIdEncoderMIME Builder XE + Indy 10.5.7 access violation  
News Group: embarcadero.public.cppbuilder.internet.socket

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

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 15-Jul-2014, at 2:16 AM EST
From: =?Utf-8?Q?Sylwester_Gli=C5=84ski?=
 
Re: TIdEncoderMIME Builder XE + Indy 10.5.7 access violation  
News Group: embarcadero.public.cppbuilder.internet.socket
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)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jul-2014, at 9:42 AM EST
From: Remy Lebeau (TeamB)