Data Abstract with c++ Builder

Hi,

I installed the latest version RO / DA 8.3.93.1183 and I must say that I was able to compile a server RO with C ++ Builder. But I have some problems with the derivation of my data service with DataAbstract, I do not know how to redefine pure virtual functions (GetSchema, GetData etc.) That are in the interface IDataAbstractService. Where and how should I define them. Because in Delphi you do not have to do all this? And maybe is possible to have an example of a project with these features?
I think that you have worked hard to make this amazing product and that’s why I decided to renew my subscription.
I hope that will help me for writing applications better and better!

thanks and bye
Adriano

RemObjectSDK and DataAbstrac Version 8.3.93.1183
Embarcadero RAD Studio 10 Seattle Version 23.0.20618.2753

you don’t need to redefine that standard methods.
I can suggest to define new methods in your RODL like MyGetSchema, MyGetData etc and implement them in your _impl.

Hi EvgenyK,

I want only to derive my service from TDataAbstractService in my impl:

'#include DataAbstractService_impl.hpp’
class TDS : public TDataAbstractService, IDS // implements IDS
{
typedef TDataAbstractService inherited;

and use the methods defined and implemented in class TDataAbstracService

but receive compiler error:
[bcc32 Error] DataAbstractService_impl.hpp(315): E2370 Simple type name expected in the row:
__property TDASchemaElementAccessValidationEvent OnValidateDatasetAccess = {read=fOnGetDatasetDataValidation, write=fOnGetDatasetDataValidation}; in the class TDataAbstractService

Maybe wrong include manually DataAbstractService_impl.hpp ?

Thanks, logged as bugs://73710

in Delphi, you don’t need to redefine interface methods that were implemented in parent object.

For C++Builder, I’ve used

	virtual System::UTF8String __fastcall GetSchema(const System::UTF8String aFilter){
		return inherited::GetSchema(aFilter);
	}
	virtual Urobinarymemorystream::TROBinaryMemoryStream* __fastcall GetData(StringArray* const aTableNameArray, TableRequestInfoArray* const aTableRequestInfoArray)
	{
		return inherited::GetData(aTableNameArray,aTableRequestInfoArray);
	}
	virtual Urobinarymemorystream::TROBinaryMemoryStream* __fastcall UpdateData(Urobinarymemorystream::TROBinaryMemoryStream* const aDelta)
	{
		return inherited::UpdateData(aDelta);
	}
	virtual int __fastcall ExecuteCommand(const System::UTF8String aCommandName, DataParameterArray* const aParameterArray)
	{
		return inherited::ExecuteCommand(aCommandName, aParameterArray);
	}
	virtual int __fastcall ExecuteCommandEx(const System::UTF8String aCommandName, DataParameterArray* const aInputParameters, /* out */ DataParameterArray* &aOutputParameters)
	{
		return inherited::ExecuteCommandEx(aCommandName,aInputParameters,aOutputParameters);
	}
	virtual System::UTF8String __fastcall GetTableSchema(StringArray* const aTableNameArray)
	{
		return inherited::GetTableSchema(aTableNameArray);
	}
	virtual System::UTF8String __fastcall GetCommandSchema(StringArray* const aCommandNameArray)
	{
		return inherited::GetCommandSchema(aCommandNameArray);
	}
	virtual Urobinarymemorystream::TROBinaryMemoryStream* __fastcall SQLGetData(const System::UTF8String aSQLText, const bool aIncludeSchema, const int aMaxRecords)
	{
		return inherited::SQLGetData(aSQLText,aIncludeSchema, aMaxRecords);
	}
	virtual Urobinarymemorystream::TROBinaryMemoryStream* __fastcall SQLGetDataEx(const System::UTF8String aSQLText, const bool aIncludeSchema, const int aMaxRecords, const System::UnicodeString aDynamicWhereXML)
	{
		return inherited::SQLGetDataEx(aSQLText,aIncludeSchema, aMaxRecords,aDynamicWhereXML);
	}
	virtual int __fastcall SQLExecuteCommand(const System::UTF8String aSQLText)
	{
		return inherited::SQLExecuteCommand(aSQLText);
	}
	virtual int __fastcall SQLExecuteCommandEx(const System::UTF8String aSQLText, const System::UnicodeString aDynamicWhereXML)
	{
		return inherited::SQLExecuteCommandEx(aSQLText,aDynamicWhereXML);
	}
	virtual System::UTF8String __fastcall GetDatasetScripts(const System::UTF8String DatasetNames)
	{
		return inherited::GetDatasetScripts(DatasetNames);
	}
	virtual void __fastcall RegisterForDataChangeNotification(const System::UTF8String aTableName)
	{
		return;
	}
	virtual void __fastcall UnregisterForDataChangeNotification(const System::UTF8String aTableName)
	{
	return;
	}

I’ve attached blank DA project. it can be used as an template for new project.

also archive contains updated DataAbstractService_Impl.hpp (you need to drop it into DA\Dcu\D23\win32)

da_cpp.zip (62.3 KB)

Ok, good job, now it compile !!!

And I can also see the definition of Rodl in the browser, but I can not create a client with the wizard, then //.#ROGEN:Project37.rodl I can’t add methods via service builder otherwise overwrite interfaces and lost redefinitcion of DataAbstracService_Proxy.

I also tried adding the method GetSchema in operations of NewService1, but still the wizard goes into error of access violation.

I’ve updated my testcase and added an client that shows content of InterBase table via IBX driver.
da_cpp.zip (109.9 KB)

there is problem with cpp codegen is present when it can’t generate properly _invk and _impl files for services that have ancestor (DA is case of it), so you need to update them manually.

Ok EvgenyK,

Thank you very much, all right, now I can continue with the development of my application server Data Abstract with C ++ Builder.
All this because I have to migrate an old application written in C ++ recovering most of the functions, which otherwise in delphi would have to rewrite them from scratch.
Thanks again for the help and the fast availability of the answers with a lot of examples.

Ciao

:grinning:

bugs://73710 got closed with status fixed.