Skip to content

C++ AdFax.hpp E2109 Not an allowed type #34

@dan27125

Description

@dan27125

+++++++++++++++++++++++++++++++++++++++++++++FIX C++ compiler error E2109 Not an allowed type in AdFax.hpp.
++++++++++++++++++++++++++++++++++++++++++++++

I'm a C/C++ programmer with very little Delphi Pascal experience. I have a high volume outbound Fax Server APP that was built 20 years ago using C++ Builder 6 and a AsyncPro. I recently got the app to compile and run OK using C++Builder/Rad studio version 10.3 Tokyo. However, when using C++ Builder to compile my fax outbound fax app I was getting compiler error E2109 Not an allowed type in a number of places within AdFax.hpp. The HPP files are generated when you build the C++ package. For some reason when the package is compiled "__published:" on some items is a problem when the HPP files are created.

For troubleshooting I can manually edit AdFax.hpp, change "__published:" to public: in about 6 changes one line changes to a number the C++ classes similar to this.... The app compiles and runs OK with 10.2 Tokyo. But under 11.x Alexandria it crashes. I'm a C/C++ programmer with very little Delphi Pascal experience. From what I've read about Delphi Published vs Public, the latter, public omits run time type information. I suspect the edit to AdFax.hpp changing from publish to public is not a safe valid fix because its changing intended run time type information

Could you help me figure out how to fix the Delphi / Pascal code ?

Searching online I found something similar error from almost 20 years ago

https://sourceforge.net/p/tpapro/discussion/241882/thread/823a8ad8/

Here is an example of the changes one line changes to a number the C++ classes similar to this....

class PASCALIMPLEMENTATION TApdReceiveFax : public TApdCustomReceiveFax
{
typedef TApdCustomReceiveFax inherited;
__published:

public: // DGA change to public to fix C++ E2109 Not an allowed type

__property AnswerOnRing = {default=1};
__property FaxAndData = {default=0};
__property FaxNameMode = {default=1};
__property OneFax = {default=0};
__property ConstantStatus = {default=0};
__property DestinationDir = {default=0};
__property OnFaxAccept;
__property OnFaxName;

public:
/* TApdCustomReceiveFax.Create / inline __fastcall virtual TApdReceiveFax(System::Classes::TComponent AOwner) : TApdCustomReceiveFax(AOwner) { }
/* TApdCustomReceiveFax.Destroy */ inline __fastcall virtual ~TApdReceiveFax(void) { }

};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions