Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Header Generation    [ Add a report in this area ]  
Report #:  27957   Status: Closed
Delphi header files are created incorrectly after Update 2
Project:  C++Builder Build #:  10.0.2288.42451
Version:    10.0 Submitted By:   Reggie White
Report Type:  Basic functionality failure Date Reported:  4/23/2006 10:47:17 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   239873
Resolution: Fixed (Resolution Comments) Resolved in Build: : 12.0.3100.14549
Duplicate of:  None
Voting and Rating
Overall Rating: (4 Total Ratings)
4.75 out of 5
Total Votes: 3
Description
It looks like this bug has come back after installing Update 2:
http://qc.borland.com/wc/qcmain.aspx?d=1857

Below is an example of how to reproduce it:

In Delphi create a project and add this (below) to a new unit called uDelphi.pas.

unit uDelphi;

interface
uses Classes;

type
TMyClass= class(TComponent)

  public
    class function GetId: integer; virtual;

    property Id: Integer  read GetId;
end;
implementation


class function TMyClass.GetId: Integer;
begin
  Result := 1;
end;
end.


Now in BCB we are going to create a new project and use uDelphi.pas within it:
So create a new BCB Form project and place a TButton on the form.

Now add the 'uDelphi.pas' file to your BCB project.
Add the include of the 'uDelphi' file:
#include "uDelphi.hpp"

In the OnClick event of the Button place the following code:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i;
  TMyClass *mc = new TMyClass(NULL);

  i = mc->Id;

  delete mc;
}

Now compile your BCB project and you will see the now mangled header file.
I get the following error:
[C++ Error] uDelphi.hpp(31): E2347 Parameter mismatch in read access specifier of property Id

This is how my header looks:

namespace Udelphi
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TMyClass;
class PASCALIMPLEMENTATION TMyClass : public Classes::TComponent
{
typedef Classes::TComponent inherited;

public:
/* virtual class method */ virtual int __fastcall GetId(TMetaClass* vmt);     <----PROBLEM
__property int Id = {read=GetId, nodefault};
public:
#pragma option push -w-inl
/* TComponent.Create */ inline __fastcall virtual TMyClass(Classes::TComponent* AOwner) : Classes::TComponent(AOwner) { }
#pragma option pop
#pragma option push -w-inl
/* TComponent.Destroy */ inline __fastcall virtual ~TMyClass(void) { }
#pragma option pop

};


Thanks
Steps to Reproduce:
Below is an example of how to reproduce it:

In Delphi create a project and add this (below) to a new unit called uDelphi.pas.

unit uDelphi;

interface
uses Classes;

type
TMyClass= class(TComponent)

  public
    class function GetId: integer; virtual;

    property Id: Integer  read GetId;
end;
implementation


class function TMyClass.GetId: Integer;
begin
  Result := 1;
end;
end.


Now in BCB we are going to create a new project and use uDelphi.pas within it:
So create a new BCB Form project and place a TButton on the form.

Now add the 'uDelphi.pas' file to your BCB project.
Add the include of the 'uDelphi' file:
#include "uDelphi.hpp"

In the OnClick event of the Button place the following code:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i;
  TMyClass *mc = new TMyClass(NULL);

  i = mc->Id;

  delete mc;
}

Now compile your BCB project and you will see the now mangled header file.
I get the following error:
[C++ Error] uDelphi.hpp(31): E2347 Parameter mismatch in read access specifier of property Id

This is how my header looks:

namespace Udelphi
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TMyClass;
class PASCALIMPLEMENTATION TMyClass : public Classes::TComponent
{
typedef Classes::TComponent inherited;

public:
/* virtual class method */ virtual int __fastcall GetId(TMetaClass* vmt);     <----PROBLEM
__property int Id = {read=GetId, nodefault};
public:
#pragma option push -w-inl
/* TComponent.Create */ inline __fastcall virtual TMyClass(Classes::TComponent* AOwner) : Classes::TComponent(AOwner) { }
#pragma option pop
#pragma option push -w-inl
/* TComponent.Destroy */ inline __fastcall virtual ~TMyClass(void) { }
#pragma option pop

};
Workarounds
None
Attachment
JED692.zip
Comments

David Dean at 4/24/2006 10:00:58 AM -
I attached a project which demonstrates this report.

Jean-Marie Babet at 4/27/2006 10:52:23 PM -
Regression: See #1857

David Perkins at 5/9/2006 2:44:45 AM -
This bug has now rendered some of my third-party Delphi components unusable.  What's the workaround, reinstalling BCB2006 without Update2?

David Dean at 5/9/2006 6:53:38 AM -
Yes, this bug is not present when using build 2166, the update 1 build.

Simon Beavis at 10/9/2007 12:30:35 PM -
This appears to still be a problem in C++Builder 2007 R2 Version 11.0.2804.9245.
Can anyone confirm if/when this is likely to be fixed?

Server Response from: ETNACODE01