C++Builder _Intf code with 9.1.99.1273 is not usable

Hello,

I’ve just updated to 9.1.99.1273, and when rebuilding the _Intf and so on, I’m getting several compile errors with the _Intf unit (at least.

For instance:

[bcc32 Error] tsInfo1_Intf.cpp(525): E2285 Could not find a match for 'TUsoSistemas_Proxy::TUsoSistemas_Proxy(TROUri * const,UnicodeString)'
  Full parser context
    tsInfo1_Intf.cpp(523): parsing: _di_IUsoSistemas _fastcall CoUsoSistemas::Create(TROUri * const,UnicodeString)
[bcc32 Error] tsInfo1_Intf.cpp(538): E2285 Could not find a match for 'TUsoSistemas_Proxy::TUsoSistemas_Proxy(const UnicodeString,UnicodeString)'
  Full parser context
    tsInfo1_Intf.cpp(536): parsing: _di_IUsoSistemas _fastcall CoUsoSistemas::Create(const UnicodeString,UnicodeString)
[bcc32 Error] tsInfo1_Intf.cpp(565): E2285 Could not find a match for 'TUsoSistemas_AsyncProxy::TUsoSistemas_AsyncProxy(TROUri * const,UnicodeString)'
  Full parser context
    tsInfo1_Intf.cpp(563): parsing: _di_IUsoSistemas_Async _fastcall CoUsoSistemas_Async::Create(TROUri * const,UnicodeString)
[bcc32 Error] tsInfo1_Intf.cpp(656): E2316 'SetAutoGeneratedNamespaces' is not a member of '_di_IROMessage'
  Full parser context
    tsInfo1_Intf.cpp(651): parsing: int _fastcall TUsoSistemas_Proxy::RegistrarUsoSistema(const TipoSistema,const int,const int,const int,const AnsiString,const int,const UnicodeString,const TDateTime,const TDateTime,const AnsiString)
[bcc32 Error] tsInfo1_Intf.cpp(693): E2316 'SetAutoGeneratedNamespaces' is not a member of '_di_IROMessage'
  Full parser context
    tsInfo1_Intf.cpp(688): parsing: bool _fastcall TUsoSistemas_Proxy::GetFechaMinimaLicencia(const TipoSistema,const int,TDateTime &)
[bcc32 Error] tsInfo1_Intf.cpp(724): E2285 Could not find a match for 'TROProxy::TROProxy(TROUri * const)'
  Full parser context
    tsInfo1_Intf.cpp(723): parsing:  _fastcall TUsoSistemas_Proxy::TUsoSistemas_Proxy(TROUri * const)
[bcc32 Error] tsInfo1_Intf.cpp(729): E2285 Could not find a match for 'TROProxy::TROProxy(const UnicodeString)'
  Full parser context
    tsInfo1_Intf.cpp(728): parsing:  _fastcall TUsoSistemas_Proxy::TUsoSistemas_Proxy(const UnicodeString)

I can try to fix the first few (just commenting the aDefaultNamespace parameter on the CoService::Create method, but the others are, I think somewhat more complex to find, and being that this are the _Intf units that are regenerated all the time, the only real solution is to fix the templates.

Have you tried to compile the C++Builder generated units with the latest version? Any simple service will produce this errors

There are basically 2 different issues here:

  1. The call to SetAutoGeneratedNamespaces is using .where it should be the -> operator, i.e:

    Uroclientintf::_di_IROMessage lMessage;
    Uroclientintf::_di_IROTransportChannel lTransportChannel;
    Uroasync::_di_IROAsyncRequest lResult;
    lMessage = __GetMessage();
    lMessage->SetAutoGeneratedNamespaces(DefaultNamespaces());
    lTransportChannel = __TransportChannel;

Instead of (the original)

  Uroclientintf::_di_IROMessage lMessage;
  Uroclientintf::_di_IROTransportChannel lTransportChannel;
  Uroasync::_di_IROAsyncRequest lResult;
  lMessage = __GetMessage();
  lMessage.SetAutoGeneratedNamespaces(DefaultNamespaces());
  lTransportChannel = __TransportChannel;

This is also present on the End… method:

  bool lResult;
  aRequest->ReadResponse();
  aRequest->Message->SetAutoGeneratedNamespaces(DefaultNamespaces());

Instead of

  bool lResult;
  aRequest->ReadResponse();
  aRequest->Message.SetAutoGeneratedNamespaces(DefaultNamespaces());
  1. The services’ constructors don’t include the new aDefaultNamespaces parameter, in any cases: _Proxy, _AsnycProxy and _AsyncProxyEx

Fixing this allows the compiler to process the units, and hopefully to work without problems.

How can I fix this here while you produce an update, or, even better, can you produce a hotfix with this? I certainly can’t fix by hand all the code that is generated in a real world service.

Thanks.

Another suggestion:

Add a #pragma hdrstop at the top of the _Intf.cpp and _Invk.cpp units (anywhere before the #include for the header of that unit) so the compiler doesn’t try to use that code for the Precompiled Header (which will produce a warning and will disable the PCH creation/use, thus making the compiling slower).

Before, this did not happen (as far as I remember), but now with the aDefaultNamespaces = "" parameter for the constructor it does.

Thanks, logged as bugs://76787

bugs://76787 got closed with status fixed.

Thanks for the quick solution.

Is it possible to get the needed files (I believe it’s only 1 DLL?) so I can patch my install, instead of waiting for the next update? I don’t have what’s needed to download and compile the CodeGen projects myself.

I tried downloading the source code from GitHub for both projects, installing Elements, etc., but I was not able to compile them: I got lots of errors when compiling, or even missing files.

As there are no clear instructions (at least I did not find any) on how to setup a working environment to compile this… I am not sure it’s going to be possible for me to even setup something that could allow me to create the needed files to fix this.

you can temporary disable generating files from rodl via changing #ROGEN with #.ROGEN


for compiling, you need to have Codegen4 and ROCodeGen.

another tricky thing:
you shouldn’t apply 76478: Optimize TROStreamSerializer.ReadArray commit because it requires RO changes that were made after latest RTM